Questions tagged [beginreceive]

35 questions
0
votes
1 answer

BeginReceive trailing Null character/chr(0)

I'm coding an ascynchronous socket client for transferring files (following this Microsoft article) and notice that using BeginReceive corrupts the transfer because it adds a single Null character/chr(0) at the end of each packet. What could be…
user1309276
  • 109
  • 1
  • 6
0
votes
1 answer

Reading POP3 email with BeginReceive goes wrong with special characters

I'm using the BeginReceive from Socket to receiving data from a e-mail. I create a StringBuilder to put in the last position of the BeginReceive method, in object state It works but StringBuilder was with strange characters. Instead of a basic…
Gelásio
  • 1,899
  • 1
  • 19
  • 18
0
votes
1 answer

Regarding Callback method used for BeginReceive method

Following is the callback method that I use in my socket programming at client side for async receiving of data from server:- Public Sub Connect() m_clientSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) …
0
votes
1 answer

.NET Socket.BeginReceive: number of bytes read

I've been looking at the packet capturing code here out of curiosity. There's a section like this: private void OnReceive(IAsyncResult ar) { try { int nReceived = mainSocket.EndReceive(ar); //Analyze the bytes received... …
Bitwise
  • 111
  • 8
-1
votes
1 answer

EndReceive Never never finishes receiving vb Net

i'm using the example of Microsoft (Visual Basic net 4.5) to send and receive datas throw socket, but this block is always true: Private Sub OnRecieve(ByVal ar As IAsyncResult) Try Dim state As StateObject = CType(ar.AsyncState,…
bluesky777
  • 400
  • 6
  • 23
1 2
3