473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Strange problem with System.Net.Sockets.TcpClient()

Hi All and Happy New Year ;)

I have a very strange problem with System.Net.Sockets.TcpClient().
For some reason, the number of bytes I can receive is limited to 5460 bytes.
I made sure that the server really sends everything I expect it to send. I
am actually sending XML messages and this limit is a pain in the ...

Here is the code:
--------------------------------------------------------------------------
Dim tcpclient As New System.Net.Sockets.TcpClient()
tcpclient.Connect(Server_IP, portNumber)

Dim NWStream As NetworkStream = tcpclient.GetStream
Dim bytesToSend As Byte() = Encoding.ASCII.GetBytes(pInText)

'---send the text
NWStream.Write(bytesToSend, 0, bytesToSend.Length)

'---read back the text
Dim bytesToRead(tcpclient.ReceiveBufferSize) As Byte

' HERE IS THE PROBLEM - numBytesRead for some reason is limited to 5460
bytes
Dim numBytesRead As Int32 = NWStream.Read(bytesToRead, 0,
tcpclient.ReceiveBufferSize)Result = Encoding.ASCII.GetString(bytesToRead,
0, numBytesRead)

tcpclient.Close()

--------------------------------------------------------------------------

I would very much appreciate if somebody had a clue of what is going on
here.

Thanks,
Torsten
--
In the force if Yoda's so strong, construct a sentence with words in the
proper order then why can't he?
Nov 18 '05 #1
0 1932

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

Similar topics

2
by: Jim W | last post by:
This is a cross-post from the .NET group since it looks like it may not be ..NET. New information since the original post is that is the wireless network is enabled and connected the socket...
4
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
4
by: Ron | last post by:
Greetings, below is a sample app for connecting to a mainframe server using Sockets for the purpose of using FTP service to interact with it from a PC. I got as far as creating the connection....
11
by: myhyli | last post by:
I want to get some files from another remote server,so: 1.at first, I use xmlhttp(activeXObject),but I found it will not work with some url like: http://rss.xinhuanet.com/rss/it.xml , and some...
4
by: Sueffel | last post by:
Boy, someday I may get good at this stuff! Until then, I have a "TCP server" that accepts multiple connections. That all works wonderfully! YEAH!!!! I have a TCPClient that is the client...
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
0
by: Tim Wagaman | last post by:
I an having issuses with a loop I am running to keep checking for messages coming across our line. The goal: Listen for messages on port 5001 and print the messages into a text file. The port...
0
by: BiT | last post by:
Hello I wrote a code to d.l message from newgroups and display it in text box, the code work fine but when the message is large it only display 27k from the message. any idea how to fix it? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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 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.