Constructors: |
|
Properties: |
|
Methods: |
|
Returns true if the socket is currently bound to a local address.
See also Bind
Return true id the socket is currently connected to a remote host.
See also Connect
Accepts a new connection from a remote host.
The method will block until a new connection is accepted.
The socket must be a server socket. If the socket has not been bound, it will first be bound to a system generated host address and port number.
See also Bind
Accepts a new connection from a remote host asynchronously.
The method returns immediately. Once a new connection is accepted, the OnAcceptComplete method of the onComplete object is called.
The socket must be a server socket.
In order to allow multiple incoming connections, your code should call AcceptAsync again somewhere inside OnAcceptComplete.
Binds the socket to a local host and port.
If host is "", the socket will be bound to a system allocated host address, generally "localhost" or "127.0.0.1".
If port is 0, the socket will be bound to a system allocated port number.
Returns true if successful. This method will fail if the socket is already bound to a port, or the binding failed, for example if port is already in use.
In the case of server sockets, Bind will cause the server to start listening.
See also LocalAddress
Binds the socket to a local host and port asynchronously.
The method returns immediately. Once the bind operation is complete, the OnBindComplete method of the onComplete object is called.
Connects the socket to a remote host.
The method will block until the connection completes.
Returns true if the connection was successful.
The socket must be a stream or datagram socket.
See also RemoteAddress
Connects a socket to a remote host asynchronously.
The method returns immediately. Once the connection is complete, the OnConnectComplete method of the onComplete object is called.
The socket must be a stream or datagram socket.
Receives data from a remote host and returns the number of bytes received.
The method blocks until either at least 1 byte of data has been received or the socket is closed.
The socket must be a connected stream or connected datagram socket.
See also Send
Receives data from a remote host and returns the number of bytes received.
The method blocks until either count bytes of data have been received or the socket is closed.
The socket must be a connected stream or connected datagram socket.
See also Send
Receives data from a remote host asynchronously.
The method returns immediately. Once either count bytes of data have been received or the socket is closed, the OnReceiveComplete method of the onComplete object is called.
The socket must be a connected stream or connected datagram socket.
Note: Be careful not to modify data or address while the operation is in progress.
Receives data from a remote host asynchronously.
The method returns immediately. Once at least 1 byte of data has been received or the socket is closed, the OnReceiveComplete method of the onComplete object is called.
The socket must be a connected stream or connected datagram socket.
Note: Be careful not to modify data or address while the operation is in progress.
Receives data from a remote host and returns the number of bytes received.
The method blocks until at least 1 byte of data is available or the socket is closed.
The address of the remote host that the data was sent from is written to address.
The socket must be an unconnected datagram socket.
Receives data from a remote host asynchronously.
The method returns immediately. Once at least 1 byte of data has been received or the socket is closed, the OnReceiveFromComplete method of the onComplete object is called.
The address of the remote host that the data was sent from is written to address.
The socket must be an unconnected datagram socket.
Note: Be careful not to modify data or address while the operation is in progress.
Sends data to a remote host and returns the number of bytes sent.
The method blocks until either all bytes of data have been sent or the socket is closed.
The socket must be a connected stream or connected datagram socket.
See also Receive
Sends data to a remote host asynchronously.
The method returns immediately. Once all bytes of data have bben been sent or the socket is closed, the OnSendComplete method of the onComplete object is called.
The socket must be a connected stream or connected datagram socket.
Note: Be careful not to modify data while the operation is in progress.
Sends data to the remote host specified by address and returns the number of bytes sent.
The method blocks until either all bytes have been sent or the socket is closed.
The address parameter must contain a valid socket address.
The socket must be an unconnected datagram socket.
See also ReceiveFrom
Sends data to the remote host specified by address asynchronously.
The method returns immediately. Once all bytes of data have been sent or the socket is closed, the OnSendToComplete method of the onComplete object is called.
The address parameter must contain a valid socket address.
The socket must be an unconnected datagram socket.
Note: Be careful not to modify data or address while the operation is in progress.