Hi,
I've been having trouble recently with sending messages to a client.
The client seems to be recieving the sever output (in the console).
This has completely done me in.
I have noticed it is to do with the buffer size.
For example: -
send(client[i].clientsocket, "-h7-Endlist" , sizeof("-h7-Endlist"), 0); // is the previous send() call
-
send(client[i].clientsocket, client[id].clientname, sizeof(client[id].clientname), 0);
-
send(client[i].clientsocket, " signed in.\n" , sizeof(" signed in.\n") , 0);
Would send ' signed in.'.
And when I do somthing like this: -
send(client[i].clientsocket, "-h7-Endlist" , sizeof("-h7-Endlist "), 0); // is the previous send() call
-
send(client[i].clientsocket, " Says:\n" , 1000, 0);
-
send(client[i].clientsocket, client[id].buf , 1000, 0);
-
Would show something liek:
'beta 6
Adam signed in.'
Where 'beta 6' is displayed in the server console, and strangely gets put into send() function.
Also, this worked perfectly over a LAN connect, but not over a WAN connection.
All required ports are opend and forwarded properly.
Is this my cheesy scripting? or a fixable common error?
5 2191
Can someone please help me with this.
Banfa 9,065
Expert Mod 8TB
If the data is not getting there it is much more likely to be a connection error than a send error.
How did you connect? Was it successful (i.e. not returned errors or error callbacks)?
What were the return values of your send function calls?
Thanks for posting,
I never seemed to check for send errors, I see what they return...
Bit of a bump...
I made a flash client for it as well.
But, its very odd, it displays data that even hasnt been echoed by the server.
So, Most likely a send() error.
What is the best method of using send?
send(socket, "hello", sizeof "hello", 0),
send(socket, string, sizeof string, 0),
send(socket, "hello", 1000, 0),
or send(socket, string, 1000 , 0); ?
Please?
Could the environment affect its behaviour?
It works fine on local host, just not on another pc...
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
by: windandwaves |
last post by:
Hi Folk
I proudly send my emails using John Rhoton's code for sending them directly
via winsock.
I now want to take this system to the next level and start sending emails
with HTML content. ...
|
by: Nadav |
last post by:
Hi,
Introduction:
*************************
I am developing communication infrastructure for a streaming video server,
to achieve optimal performance I use IO Completion ports & a thread pool...
|
by: Jefe |
last post by:
Hi Guyz
well I wanna implement a tcp chat program with C# and winsock, and I know
that I should use Asynchronous methods so my windows program won't be
blocked, but in my application both clients...
|
by: Mark |
last post by:
Hi,
I have a VB6 project that uses a winsock control to receive text
messages over a UDP connection.
It used to work fine. However, when I changed the code to make it more
efficient (ie, less...
|
by: raj.rr7 |
last post by:
Hi,
I am creating a Http client application using winsock, evc++ 4.0 and K-
Jam (WIndows Mobile 5) that will get data from Http server. I am using
the following code.
WSADATA wsaData;...
|
by: danishce |
last post by:
Hello All:
I am developing a client/server application using vb.net winsock programming.
I am sending data to Server and at the same time receive the incoming data from the server.
My application...
|
by: danishce |
last post by:
I am developing a client/server application using vb.net winsock programming.
I am sending data to Server and at the same time receive the incoming data from the server.
Everything works fine but...
|
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,...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
| |