1 less memory allocation

This commit is contained in:
UnknownShadow200 2017-05-15 22:54:17 +10:00
parent decc2116ca
commit cb5310736d

View File

@ -30,13 +30,12 @@ namespace MCGalaxy.Network {
}
public string RemoteIP {
// TODO: This is very icky
get { return socket.RemoteEndPoint.ToString().Split(':')[0]; }
get { return ((IPEndPoint)socket.RemoteEndPoint).Address.ToString(); }
}
static AsyncCallback recvCallback = new AsyncCallback(Receive);
public void ReceiveNextAsync() {
socket.BeginReceive(tempbuffer, 0, tempbuffer.Length, SocketFlags.None, new AsyncCallback(Receive), this);
socket.BeginReceive(tempbuffer, 0, tempbuffer.Length, SocketFlags.None, recvCallback, this);
}
static void Receive(IAsyncResult result) {