![]() |
| | #1 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| socks4 server it works fine untill the recv() part, there, it returns error code 10038 (WSAGetLastError), can someone take a look at my code plz Last edited by apsync; 07-30-2005 at 02:13 PM. |
| apsync is offline | |
| | #2 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,700
| http://www.mailsbroadcast.com/email....rror.codes.htm Considering that the client variable in Socks4ClientThread is uninitialised, I'm surprised it gets that far |
| Salem is offline | |
| | #3 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| oh, and and how should i initialise it Last edited by apsync; 07-30-2005 at 02:03 PM. |
| apsync is offline | |
| | #4 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,700
| I'd have said pass it as a parameter from one function to another. |
| Salem is offline | |
| | #5 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| allright, thanks for replying, i did the following now; Code: DWORD WINAPI Socks4ClientThread(LPVOID pParam) Code: SOCKET client=(SOCKET)pParam; Code: Socks4ClientThread("something"); // I dunno what i have to fill here
|
| apsync is offline | |
| | #6 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,700
| Since you're not actually using threads or anything (despite the names), and just calling functions directly, you may as well have void Socks4ClientThread(SOCKET client); // prototype Socks4ClientThread(client); // call void Socks4ClientThread(SOCKET client) // definition And lose the local variable of the same name in that function. |
| Salem is offline | |
| | #7 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| thanks everything looks fine now, but for some reason it hangs at this line Code: if (connect(outbound, (SOCKADDR *)&target_in, sizeof(target_in)) == SOCKET_ERROR) |
| apsync is offline | |
| | #8 | |
| Registered User Join Date: Apr 2005
Posts: 134
| Quote:
Here is one way to do it Code: void setsockettimeout()
{
struct timeval tv;
tv.tv_sec = 30; /* timeout in 30 Secs */
setsockopt(sockid, SOL_SOCKET, SO_SNDTIMEO,(struct timeval *)&tv,sizeof(struct timeval));
setsockopt(sockid, SOL_SOCKET, SO_RCVTIMEO,(struct timeval *)&tv,sizeof(struct timeval));
return;
}
| |
| nkhambal is offline | |
| | #9 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| ah I see, thanks, now I can continue! |
| apsync is offline | |
| | #10 |
| Registered User Join Date: Dec 2004 Location: The Netherlands
Posts: 89
| hmm not working, what can I do to receive the SYN-ACK packet from server |
| apsync is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| server client application - (i really need your help) | sarahnetworking | C Programming | 3 | 03-01-2008 10:54 PM |
| Server Architecture | coder8137 | Networking/Device Communication | 2 | 01-29-2008 11:21 PM |
| Where's the EPIPE signal? | marc.andrysco | Networking/Device Communication | 0 | 12-23-2006 08:04 PM |
| IE 6 status bar | DavidP | Tech Board | 15 | 10-23-2002 05:31 PM |
| socket question | Unregistered | C Programming | 3 | 07-19-2002 01:54 PM |