Posted By: NeoJT
socket_connect.... socket_send,,, - 05/29/13 08:33
Hi and sorry for my english
Im trying to comunicate 2 servers.
The Sender send a message to Receiver when the player
hit the f5 : ( this is for testing the communication )
inside the Server-Sender
-----------------------------------------
and inside the Server-Receiver
When i tried with TCP 1 i received "Can't connect to login server"
When i tried with UDP 0 i receivec "Connect to login server" and "message send ok" ... but the Receiver dont show anything...
I was read older posts and others answer but i cant find what and where i am doing wrong
Please tell me what i am doing wrong...
thx you all... and sorry for my english.
Best Regards
Dimitris
Im trying to comunicate 2 servers.
The Sender send a message to Receiver when the player
hit the f5 : ( this is for testing the communication )
inside the Server-Sender
Code:
STRING* l_temp_1_str = " "; while(1) { if (key_f5) { while(key_f5) { wait(1); } //---------------------------------- // I use port "2300" for Server-Received and "2301" for Server-Sender //---------------------------------- if ( !socket_connect( "127.0.0.1", "2300", 1 ) ) { printf("Can't connect to login server"); } else { printf("Connect to login server"); str_cpy(l_temp_1_str, "From Sender : message sending"); var size = str_len(l_temp_1_str); var sent = socket_send(_chr(l_temp_1_str),size); if (sent) { printf("message send ok"); } } } wait(1); }
-----------------------------------------
and inside the Server-Receiver
Code:
while(1) { char input[1000]; int received = socket_receive(input,1000); if (received > 0) { input[received] = 0; // add the end mark printf("%s", input); } wait(1); }
When i tried with TCP 1 i received "Can't connect to login server"
When i tried with UDP 0 i receivec "Connect to login server" and "message send ok" ... but the Receiver dont show anything...
I was read older posts and others answer but i cant find what and where i am doing wrong
Please tell me what i am doing wrong...
thx you all... and sorry for my english.
Best Regards
Dimitris