mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
1 less memory allocation
This commit is contained in:
parent
decc2116ca
commit
cb5310736d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user