473,473 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Another winsock error. (c++)

83 New Member
Hi, my client is having problems recieving server messages.
But the client recieves the messages restricted to the lenth of the first recieved message.
In order, the server sends, "Welcome", "-Ping", and "-RequestName".
Expand|Select|Wrap|Line Numbers
  1. char buf[1000];
  2. for(;;){
  3.                     recv(mysoc, buf, 1000, 0);
  4.                     std:: cout << "Server: "<< buf << ".\n";
  5. ...
  6. }
Heres the client output:

Server: Welcome
Server: -Pingme.
Server: -Requme.

Do I need to empty buf? if so, how?
Aug 31 '08 #1
1 1255
Adam01
83 New Member
Damn, it was server:
send(client[id].clientsocket, "-RequestName", 5, 0);

Please lock/delete.
Aug 31 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
7
by: Nadav | last post by:
Hi I am writing some kind of a storage system that have to deal with large amounts of data passing over the net, Now, I Wonder... traditional programming would use win32 Winsock DLL as the means...
1
by: Minti | last post by:
Hi there all, I am using some example code about using winsock. Private Sub Form_Load() ' The control's name is udpPeerA With udpPeerA ' IMPORTANT: be sure to change the RemoteHost ' value to...
1
by: Glen Conway | last post by:
Hi, I'm trying to use the gethostbyname function from wsock32.dll and failing dismally Has anyone got a successful implementation of this in VB.NET? My ulitimate goal is to resolve NetBIOS names...
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
5
by: carrajo | last post by:
Hey, I'm trying to duplicate the following: Select List 1 --- Apple Orange Banana
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
0
by: smallGame | last post by:
Hi, I am programing with VisualC++ under Windows vista, I get a problem to link with all winsock functions. I can't find winsock.lib and with the file winsock.dll I get an error message:...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.