WinSock2 help!
-
I'm not that experienced with WinSock2 so forgive me for my bad ERROR_HANDLING. Currently I have this line of code, breaking my application!
BytesReceived = recv(IPv4, Data, sizeof(Data), 0);
Yet I believe the worst case scenario the receive buffer would be empty and BytesReceived will be -1. Unless their is a bigger picture missing, could you give me a heads up! I'm currently using the HTTP protocol with blocking sockets! If you think it's a bad design strategy, please inform me! 1) send HTTP request 2) receive HTTP response 3) buffer[512] bytes, so HTTP response + data, separate them
-
I'm not that experienced with WinSock2 so forgive me for my bad ERROR_HANDLING. Currently I have this line of code, breaking my application!
BytesReceived = recv(IPv4, Data, sizeof(Data), 0);
Yet I believe the worst case scenario the receive buffer would be empty and BytesReceived will be -1. Unless their is a bigger picture missing, could you give me a heads up! I'm currently using the HTTP protocol with blocking sockets! If you think it's a bad design strategy, please inform me! 1) send HTTP request 2) receive HTTP response 3) buffer[512] bytes, so HTTP response + data, separate them
What do you mean by break?
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
What do you mean by break?
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
What do you mean by break?
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)«_Superman_» wrote:
What do you mean by break?
Someone said coffee break? :)
Chat in Europe :java: Now with 24% more Twitter
-
«_Superman_» wrote:
What do you mean by break?
Someone said coffee break? :)
Chat in Europe :java: Now with 24% more Twitter
Unhandled exception at 0x761ed252 in Win32.exe: 0xC0000005: Access violation writing location 0x00000000. Keeps pointing at the recv function line! Update: WriteFile(File, Data, BytesReceived, NULL, NULL); This line is causing the trouble, but can't identify the problem! File is the CreateFile handle. Data is the recv buffer from WinSock2. BytesReceived is in the int returned by recv. :confused:
modified on Tuesday, May 4, 2010 9:25 PM
-
Unhandled exception at 0x761ed252 in Win32.exe: 0xC0000005: Access violation writing location 0x00000000. Keeps pointing at the recv function line! Update: WriteFile(File, Data, BytesReceived, NULL, NULL); This line is causing the trouble, but can't identify the problem! File is the CreateFile handle. Data is the recv buffer from WinSock2. BytesReceived is in the int returned by recv. :confused:
modified on Tuesday, May 4, 2010 9:25 PM