Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] Proxy

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Robotex
Master Cheater
Reputation: 0

Joined: 05 Sep 2006
Posts: 378
Location: The pizza country!

PostPosted: Sat Mar 24, 2007 12:01 pm    Post subject: [Help] Proxy Reply with quote

I'm coding a proxy, it uses blocking sockets with threads, but i'm stuck with the data transfer part.
I haven't got any problem with receiving/sending data from the server, but when i try to receive data from the client, it receives only 1 packet and then it looks like freezed (the client says Cannot access to the server, and if i retry to connect it doesn't receive the packet anymore).
The data transfer code is something like that
Code:

         iResult = recv(ServerSocket,buf,DEFAULT_BUFLEN,0);
         if (iResult > 0)
         {
            send(ClientSocket,buf,DEFAULT_BUFLEN,0);
         }
         else if (iResult == 0)
            printf("Server closed the connection");
         else
            printf("Error.");

         iResult2 = recv(ClientSocket,buf,DEFAULT_BUFLEN,0);
         if(iResult2 > 0)
         {
            send(ServerSocket,buf,DEFAULT_BUFLEN,0);
         }
         else if(iResult == 0)
            printf("Client closed the connection");
         else
            printf("Error.");
      } while (iResult > 0 && iResult2 > 0);

Log:
Quote:

Proxy connecting to: xxx.xxx.xxx.xxx:xxxx
Bytes received (Server): 26
Bytes received (Client): 731
Bytes received (Server): 15
Bytes received (Server): 23
... (no more client or received 0 bytes)



Any suggestion?

_________________

ASM/C++ Coder
Project Speranza lead developer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites