Share via


Socket.Send Method

Sends data to a bound socket.

Overload List

Name Description
Socket.Send (Byte[]) Sends all of the data currently in the buffer array to a bound socket.
Socket.Send (Byte[], Int32, Int32, SocketFlags) Sends data to a bound socket according to specified flags, beginning at a specified location in the buffer array.
Socket.Send (Byte[], Int32, SocketFlags) Sends data to a bound socket, according to specified flags.
Socket.Send (Byte[], SocketFlags) Sends all of the data currently in the buffer array to a bound socket, according to specified flags.

Remarks

If you are using a connectionless protocol, you must call the Connect method before calling the Send method; otherwise, Send will throw a SocketException exception. If you are using a connection-oriented protocol, you must either use the Connect method to establish a remote host connection or use the Accept method to accept an incoming connection.

If you are using a connectionless protocol and plan to send data to several different hosts, you should use the SendTo method. If you do not use SendTo, you will have to call Connect before each call to Send. Note that you can use SendTo even after you have established a default remote host by using Connect. You can also change the default remote host before calling Send by making another call to Connect.

Version Information

Available in .NET Micro Framework version 2.0, 2.5

See Also

Reference

Socket Class
Socket Members
System.Net.Sockets Namespace