private void Negotiate(byte[] data) { switch (data[0]) { case 0x01: _connected = true; SendMessage(new byte[] { 0x01, 0x02 }); break; case 0x02: _connected = true; //MessageBox.Show("Connected"); break; case 0x03: _remotetype = TypeofRemote.Reciever; SendMessage(new byte[] { 0x01, 0x05 }); break; case 0x04: _remotetype = TypeofRemote.Sender; SendMessage(new byte[] { 0x01, 0x05 }); break; case 0x05: //MessageBox.Show("Established"); break; } }
public bool SetRemote(TypeofRemote remotetype) { _remotetype = remotetype; // //try socket code etc // SendMessage(new byte[] { 0x01, 0x04 }); return(true); }
public NetworkGenerator(Socket socket) { _remotetype = TypeofRemote.Unknown; _uplink = socket; WaitForData(_uplink); }
public bool SetRemote(TypeofRemote remotetype) { _remotetype = remotetype; // //try socket code etc // SendMessage(new byte[] { 0x01, 0x04 }); return true; }