Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
bin
sync_socket.h
Go to the documentation of this file.
1
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_BIN_SYNC_SOCKET_H_
6
#define RUNTIME_BIN_SYNC_SOCKET_H_
7
8
#include "
bin/socket_base.h
"
9
#include "
platform/globals.h
"
10
11
namespace
dart
{
12
namespace
bin {
13
14
class
SynchronousSocket
{
15
public
:
16
explicit
SynchronousSocket
(intptr_t
fd
) : fd_(
fd
) {}
17
~SynchronousSocket
() {
ASSERT
(fd_ == kClosedFd); }
18
19
intptr_t
fd
()
const
{
return
fd_; }
20
void
SetClosedFd
() { fd_ = kClosedFd; }
21
22
static
bool
Initialize
();
23
24
static
intptr_t
CreateConnect
(
const
RawAddr
& addr);
25
26
static
Dart_Handle
SetSocketIdNativeField
(
Dart_Handle
handle,
27
SynchronousSocket
* socket);
28
static
Dart_Handle
GetSocketIdNativeField
(
Dart_Handle
socket_obj,
29
SynchronousSocket
** socket);
30
31
static
intptr_t
Available
(intptr_t
fd
);
32
static
intptr_t
GetPort
(intptr_t
fd
);
33
static
SocketAddress
*
GetRemotePeer
(intptr_t
fd
, intptr_t* port);
34
static
intptr_t
Read
(intptr_t
fd
,
void
*
buffer
, intptr_t num_bytes);
35
static
intptr_t
Write
(intptr_t
fd
,
const
void
*
buffer
, intptr_t num_bytes);
36
37
static
void
ShutdownRead
(intptr_t
fd
);
38
static
void
ShutdownWrite
(intptr_t
fd
);
39
static
void
Close
(intptr_t
fd
);
40
41
private
:
42
static
constexpr
int
kClosedFd = -1;
43
44
intptr_t fd_;
45
46
DISALLOW_COPY_AND_ASSIGN
(
SynchronousSocket
);
47
};
48
49
}
// namespace bin
50
}
// namespace dart
51
52
#endif
// RUNTIME_BIN_SYNC_SOCKET_H_
dart::bin::SocketAddress
Definition
socket_base.h:41
dart::bin::SynchronousSocket
Definition
sync_socket.h:14
dart::bin::SynchronousSocket::SynchronousSocket
SynchronousSocket(intptr_t fd)
Definition
sync_socket.h:16
dart::bin::SynchronousSocket::fd
intptr_t fd() const
Definition
sync_socket.h:19
dart::bin::SynchronousSocket::GetRemotePeer
static SocketAddress * GetRemotePeer(intptr_t fd, intptr_t *port)
dart::bin::SynchronousSocket::Available
static intptr_t Available(intptr_t fd)
dart::bin::SynchronousSocket::GetSocketIdNativeField
static Dart_Handle GetSocketIdNativeField(Dart_Handle socket_obj, SynchronousSocket **socket)
Definition
sync_socket.cc:341
dart::bin::SynchronousSocket::Initialize
static bool Initialize()
dart::bin::SynchronousSocket::CreateConnect
static intptr_t CreateConnect(const RawAddr &addr)
dart::bin::SynchronousSocket::ShutdownRead
static void ShutdownRead(intptr_t fd)
dart::bin::SynchronousSocket::Close
static void Close(intptr_t fd)
dart::bin::SynchronousSocket::~SynchronousSocket
~SynchronousSocket()
Definition
sync_socket.h:17
dart::bin::SynchronousSocket::Read
static intptr_t Read(intptr_t fd, void *buffer, intptr_t num_bytes)
dart::bin::SynchronousSocket::Write
static intptr_t Write(intptr_t fd, const void *buffer, intptr_t num_bytes)
dart::bin::SynchronousSocket::GetPort
static intptr_t GetPort(intptr_t fd)
dart::bin::SynchronousSocket::ShutdownWrite
static void ShutdownWrite(intptr_t fd)
dart::bin::SynchronousSocket::SetSocketIdNativeField
static Dart_Handle SetSocketIdNativeField(Dart_Handle handle, SynchronousSocket *socket)
Definition
sync_socket.cc:325
dart::bin::SynchronousSocket::SetClosedFd
void SetClosedFd()
Definition
sync_socket.h:20
Dart_Handle
struct _Dart_Handle * Dart_Handle
Definition
dart_api.h:258
ASSERT
#define ASSERT(E)
Definition
entrypoints_verification_test.cc:25
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
dart
Definition
dart_vm.cc:33
globals.h
DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
globals.h:581
socket_base.h
dart::bin::RawAddr
Definition
socket_base.h:33
Generated on Fri Apr 26 2024 06:14:43 for Flutter Engine by
1.9.8