public void Connect(IEndPoint endPoint) { receiveEndPoint = (NanoEndPoint)endPoint; InitSocket(); int result = UDP.Connect(socket, ref receiveEndPoint.address); if (result != 0) { throw new NanoSocketException("Socket Connect failed"); } }
public void Bind(IEndPoint endPoint) { receiveEndPoint = (NanoEndPoint)endPoint; InitSocket(); int result = UDP.Bind(socket, ref receiveEndPoint.address); if (result != 0) { throw new NanoSocketException("Socket Bind failed: address or port might already be in use"); } }