Language

CFSocket Class

Definition

CoreFoundation low-level Socket library - use the Network APIs instead.

public class CFSocket : CoreFoundation.CFType
type CFSocket = class
    inherit CFType
Inheritance

Constructors

Name Description
CFSocket()

Creates a socket for the address family family INET, socket type STREAM, and protocol TCP.

CFSocket(AddressFamily, SocketType, ProtocolType, CFRunLoop)

Creates a socket by specifying an address family, socket type and protocol type with a specified run loop to dispatch on.

CFSocket(AddressFamily, SocketType, ProtocolType)

Creates a socket by specifying an address family, scoket type and protocol type dispatched on the Current.

Properties

Name Description
Address
Handle (Inherited from DisposableObject)
Owns (Inherited from DisposableObject)
RemoteAddress

Methods

Name Description
ClearHandle() (Inherited from DisposableObject)
Connect(IPAddress, Int32, Double)

Connects the socket to the specified IP address and port.

Connect(IPEndPoint, Double)

Connects the socket to the specified endpoint.

CreateConnectedToSocketSignature(AddressFamily, SocketType, ProtocolType, IPEndPoint, Double)

Creates a connected socket by specifying an address family, socket type, protocol type as well as the endpoint to connect to.

DisableCallBacks(CFSocketCallBackType)

Disables a set of events from being raised.

Dispose()

Releases all resources used by this object.

(Inherited from DisposableObject)
Dispose(Boolean)

Releases the resources used by the CFSocket object.

EnableCallBacks(CFSocketCallBackType)

Enables a set of events to be raised.

Equals(Object) (Inherited from DisposableObject)
GetCheckedHandle() (Inherited from DisposableObject)
GetDescription(IntPtr)

Returns a textual representation of the specified object.

(Inherited from CFType)
GetHashCode() (Inherited from DisposableObject)
GetSocketFlags()

Returns the set of CFSocket-specific flags.

InitializeHandle(NativeHandle) (Inherited from DisposableObject)
Invalidate()
Release() (Inherited from NativeObject)
Retain() (Inherited from NativeObject)
SendData(Byte[], Double)

Sends data over the socket.

SetAddress(IPAddress, Int32)

Sets the listening address for this socket (equivalent to the BSD bind call).

SetAddress(IPEndPoint)

Sets the listening address for this socket (equivalent to the BSD bind call).

SetSocketFlags(CFSocketFlags)

Sets the CFSocket-specific flags.

Events

Name Description
AcceptEvent

Raised when the listening socket accepts a new incoming connection. Use the event arguments' RemoteEndPoint to inspect the remote peer and CreateSocket() to obtain a CFSocket for the accepted connection.

ConnectEvent

Raised when a background connection attempt started with one of the Connect methods completes, reporting whether the connection succeeded or failed.

DataEvent

Raised when a complete block of data has been read from the socket and is available in the event arguments.

ReadEvent

Raised when the socket has data available to be read.

WriteEvent

Raised when the socket is ready to accept data to be written without blocking.

Extension Methods

Name Description
GetHandle(INativeObject)
GetNonNullHandle(INativeObject, String)

Applies to