Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Client/Server TCP packet troubles...

Posted on 2003-11-07
4
Medium Priority
?
322 Views
Last Modified: 2013-12-07
I have two apps: the server with MFC sockets (CAsyncSocket) and a client with Win32 API sockets (NO MFC!)...
The problem:
1) When I send large amount of data, it arrives like several small packets. Is there a way to automatically merge this packets?
2) When I send several small packets in a short period of time, it arrives like ONE bigger packet. I need them to come in DIFFERENT packets - the way I send them.
0
Comment
Question by:WtG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:WtG
ID: 9700441
Solved by sending datasize along with the data in packet and merging/splitting manually upon arrival.
Maybe there IS an easier way to do this?

Another question:
Are Accept/Send/Recv functions fast enough to keep in server's main thread with multiple clients? With slow networks and client drops. Or should I create a sending thread for each client?

Thanx.
0
 
LVL 5

Expert Comment

by:vtobusman
ID: 9702017
 you can run all of those functions in the main thread assuming you have a pretty decent server...  the question would be how many clients and haw fast is the connection to the server ??
if you are on a local lan ( 100 mbps ) and have 300 users i would set them in different threads but if you have say 500 users and all connected thru the internet and you have say a T1 to the internet the memory ( RAM ) is more important and you can runn all in the same thread... it really depends on you setup...

  hope that sheds some light on you situation..

 and good luck
0
 
LVL 3

Accepted Solution

by:
guynumber5764 earned 1000 total points
ID: 9703684
1) In general there is no easier way using TCP.  TCP just thinks of your data as a continuous stream which it can break up any way it wants--it is up to the application to interpret that stream (as you have done with your datasize).  It is worth noting that, once you are dealing with the Internet, your data may be arbitrarily merged or split several times along the way.

2) It doesn't matter too much which way you do it as long as you don't assume the requests/responses are coming in any specific sequence (ie: never block on an anticipated response).  Unless you are using SMPs, I would expect very little performance difference between the two approaches---it's mostly a matter of readability.
0
 

Author Comment

by:WtG
ID: 9703740
Thanx :]
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question