Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 07.11.2006, 09:44   #1
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

TCP is a Streaming Protocol, please go read what that means. It doesn't matter if you use Sync or Async sockets, the TCP packets will come at you in order, but they will have no packet breaks. In essence, you will get one giant, never-ending stream of bytes. This is why you have to read the len from the packet and only read len bytes. Otherwise, you will never know where the start and end of a packet are.

I did socket programming in C++ using TCP, so I'm not talking up a storm without experience.
mcrabben7 is offline  
Old 07.11.2006, 13:31   #2
Menta2K
Архивный участник
 
Join Date: Nov 2006
Posts: 13
Default

Quote:
Originally Posted by mcrabben7 View Post
TCP is a Streaming Protocol, please go read what that means. It doesn't matter if you use Sync or Async sockets, the TCP packets will come at you in order, but they will have no packet breaks. In essence, you will get one giant, never-ending stream of bytes. This is why you have to read the len from the packet and only read len bytes. Otherwise, you will never know where the start and end of a packet are.

I did socket programming in C++ using TCP, so I'm not talking up a storm without experience.
Sorry but i cannot agree with that
its depends how you are using the sockets
In example
in C if you are using
int recv(int sockfd, void *buf, int len, unsigned int flags);
return value is how much data (bytes ) actualy comes to that socket and now here is the "Solved" question recv recived 26 bytes of data and in this 26 bytes we have 2 game packets.
Menta2K is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 18:58.