![]() |
|
#1
|
|||
|
|||
Linux Socket send() maximum sizeHi, I am having problem with socket function send();
Is there any limit how many characters can I send with send() function. On the client side I have QT 4.2.2 client with read method. Is there a problem with server side socket send() function ? Any limit or something ? Or client side ? |
|
#2
|
|||
|
|||
Re: Linux Socket send() maximum sizeQuote:
You may send a maximum of the upper range of the largest number supported by a "size_t" (usually an unsigned int) on your system using a single send (2) call. CPP / C++ / C Code:
Check the return value to see if it is sending the number of bytes that you expect. :davis: |
|
#3
|
|||
|
|||
Re: Linux Socket send() maximum sizeQuote:
If by "having a problem" do you mean that send() returned -1? Or what? If it returned -1, did you use perror() to try to print an error message? (If so, what did the message say? If not, then I suggest you give it a try.) Since send() is not a standard C library function, details of its operation and limitations depend on the operating system and the compiler that you are using. However, in general... 1. The send() function will fail if you try to send more octets than the maximum packet size of the underlying protocol.(For example, maximum UDP packet size is 65535 bytes, I think.) 2. Also, many (most???) implementations have a limited buffer size for data that may be smaller than this value. If the socket was opened in blocking mode, the socket will block. If the socket is in non blocking mode and you attempt to send more octets than the buffer size send() will fail. In most cases, perror() should tell you what the error was. If none of this helps, perhaps you could give us a few more details. (Like telling us the compiler and operating system. Like telling us the underlying protocol. Like describing any debugging steps that you have tried --- sending smaller packets, for example. Specifically: What worked? What didn't work?) Regards, Dave Last edited by davekw7x : 22-Jan-2007 at 13:24.
|
|
#4
|
|||
|
|||
Re: Linux Socket send() maximum sizeI am using Windows XP SP2 and Visual Studio .NET 2005. So, what should be the maximum packet size that I can send()?
|
|
#5
|
|||
|
|||
Re: Linux Socket send() maximum sizeQuote:
If you read my previous post, you may realize that the answer is, "It depends." What, exactly, do you want to do? What, exactly, have you tried? What, exactly, happened? What, exactly, is the problem? Regards, Dave |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [PROGRAM] Winsock Programming | Max Payne | MS Visual C++ / MFC Forum | 1 | 09-Mar-2007 00:38 |
| Need Help With Recursive Functions | jonas12rena | C Programming Language | 1 | 31-Jul-2006 12:12 |
| sudoku C++, need lots of help :S | 3shtar | C++ Forum | 3 | 06-Apr-2006 11:10 |
| Having a problem | Chuckles | Computer Hardware Forum | 19 | 13-Sep-2004 13:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The