I don't understang how you received data
TCP protocol ok....
I have read PacketHandlers.cs & Co, but i don't understand.
I want to make a little client (without graphic) in order to make one or two action. I stop on login...
How i must send my data ?
I have make this (client code):
[/code]
Ideas ?
TCP protocol ok....
I have read PacketHandlers.cs & Co, but i don't understand.
I want to make a little client (without graphic) in order to make one or two action. I stop on login...
How i must send my data ?
I have make this (client code):
Code:
SendData("0x91");
SendData("?"+log.Substring(0,30)+pass.Substring(0,30)+"]");
[/code]
Code:
public void SendData(string data)
{
byte[] bufferSend =
System.Text.Encoding.Default.GetBytes(data);
try{
m_socket.Send(
bufferSend,0,
bufferSend.Length,
SocketFlags.None);
}
catch(Exception e){
Console.WriteLine(e.TargetSite.ToString() + ":\n"+e.Message.ToString() );
}
}
Code:
public void GetData()
{
while(true){
try{
byte[] bufferGet =
new Byte[m_socket.Available];
int sortie = m_socket.Receive(bufferGet);
string data =
System.Text.Encoding.ASCII.GetString(
bufferGet, 0, bufferGet.Length);
if(data.Length != 0){
//TEMPO
Console.WriteLine("Data Get: "+data);
}
}
catch(Exception e){
Console.WriteLine(e.TargetSite.ToString() + ":\n"+e.Message.ToString() );
Console.WriteLine("Try disconnect...");
Disconnect();
}
Thread.Sleep(50);
}
}
Ideas ?