![]() |
help with displaying message
hi, im trying to learn how to use winsock in C++ programs so ive tried to make a small client/server thing where the client sends a message and the server responds. My problem is that, although they are connecting, and i think they are probably recieving the messages, i cant get the recieved message to be displayed on the console window.
:
send(sockfd, *ping, 4, 0);:
recv(new_sockfd, *buf, 256, 0);Client OUTPUT: Client> ping Server> (some wierd stuff that im not gonna bother to write) Server OUTPUT: Client> (blank) Server> pong HAYELLP!!! |
You should show how 'ping', 'pong', and 'buf' are declared. The dereferencing you're doing doesn't look right, but it depends on what 'buf' ect is to say what is right.
|
yeah, long after i posted i thought i shoulda probably done that, but i fixed it anyway. I had to change the type i was using from char* to char. I still have a little odd output but i should be able to fix that. ty
|
| All times are GMT -5. The time now is 12:25 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC