Archived

This topic is now archived and is closed to further replies.

Another Newbie Winsock Question

This topic is 5627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites