Advertisement

Another Newbie Winsock Question

Started by July 23, 2002 12:42 PM
3 comments, last by Evil Bill 22 years, 6 months ago
If i want a client-server app, do i need to have 2 sockets on each computer, one for sending and one for recieving, or is there a way to use just the one socket for input & output? Cheers, Steve Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
Just one client socket for input and output
Darkhaven Beta-test stage coming soon.
Advertisement
This is what i do:
Client:
Create
Connect
Send
Close
And that works fine.

Server:
Create Socket
Listen
Accept
Send
Close
But the client doesn''t get any data from the server (or the server doesn''t send it)

Any ideas whats missing?

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)
this might not be right but...

I think you''re missing a recv() call somewhere in there

int recv(int sockfd, void *buf, int len, unsigned int flags);

sockfd is socket definition, *buf is where you''re recieving it, len is maximum length *buf can be, and flags I leave as 0.

hope thats right
I''ve fixed it now, i wasn''t doing a WSAAsyncSelect(...,FD_READ) if this was a client.

Cheers, Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates
Member of the Unban Mindwipe Society (UMWS)

This topic is closed to new replies.

Advertisement