public static SendMessage ( byte Message, |
||
Message | byte | Supplies the bytes to send. |
Destination | Supplies the destination network address. /// | |
DestinationPort | int | Supplies the destination port. /// |
return | void |
public static void SendMessage(byte[] Message, IPAddress Destination, int DestinationPort)
{
sockaddr_in sin = new sockaddr_in()
{
sin_family = AF_INET,
sin_port = (ushort)IPAddress.HostToNetworkOrder((short)DestinationPort),
#pragma warning disable 618
sin_addr = (uint)Destination.Address,
#pragma warning restore 618
sin_zero = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }
};
SendMessage(Message, sin);
}
SocketIo::SendMessage ( byte Message, sockaddr_in Destination ) : void |
/// <summary> /// Send a direct message to a server. Failures are ignored. /// </summary> /// <param name="Data">Supplies the message payload.</param> /// <param name="Server">Supplies the destination server.</param> private void SendMessageToServer(byte[] Data, GameServer Server) { try { IPAddress Address; if (Server.ServerId == LocalServerId) { Address = IPAddress.Loopback; } else { Address = Server.GetIPAddress(); } SocketIo.SendMessage(Data, Address, Server.ServerPort); } catch { } }