| | |
TCP Socket Question
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2008
Posts: 13
Reputation:
Solved Threads: 0
My problem is that I am not receiving all of the data that I should be. I am only receiving 7 records rather then receiving 12. Is there a time limit that a socket can recieve for? Is there something else that could be my problem that I would not be receiving all of the information that the server is definitly sending me?
My receive code
All of the code
My receive code
VB.NET Syntax (Toggle Plain Text)
Dim cpBytesRec As Int64 = sender2.Receive(bytes) dataFromCp = Encoding.ASCII.GetString(bytes, 0, cpBytesRec) Console.WriteLine("Data From ChoicePoint = {0}", dataFromCp)
All of the code
VB.NET Syntax (Toggle Plain Text)
Private Function TransmitToCP(ByVal data As Byte()) As String Dim cpPort As Integer = 10102 Dim bytes(1500) As Byte Dim dataFromCp As String = "" Dim CPDATA As String = "" Dim longip As IPAddress longip = IPAddress.Parse("67.241.41.236") Try Dim cpServerEP As New IPEndPoint(longIP, cpPort) ' Create a TCP/IP socket. Dim sender2 As New Socket(AddressFamily.InterNetwork, _ SocketType.Stream, ProtocolType.Tcp) Console.WriteLine("Socket waiting to connect to cp") ' Connect the socket to the remote endpoint. Catch any errors. Try sender2.Connect(cpServerEP) Console.WriteLine("Socket connected to cp {0}", _ sender2.RemoteEndPoint.ToString()) ' Send the data through the socket. Dim bytesSent As Integer = sender2.Send(data) ' Receive the response from the remote device. Dim cpBytesRec As Int64 = sender2.Receive(bytes) dataFromCp = Encoding.ASCII.GetString(bytes, 0, cpBytesRec) Console.WriteLine("Data From ChoicePoint = {0}", dataFromCp) ' Release the socket. sender2.Shutdown(SocketShutdown.Both) sender2.Close()
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Solved Threads: 0
If u socket.flush() after sending data , i think it you will get all records .
If you a beginner in vb.net socket programming , just follow the link , that one is intenteded for beginners .
http://vb.net-informations.com/commu...rogramming.htm
bonave
If you a beginner in vb.net socket programming , just follow the link , that one is intenteded for beginners .
http://vb.net-informations.com/commu...rogramming.htm
bonave
![]() |
Similar Threads
- need help TCPIP socket (C#)
- How to configure "keep alive" in Sockets? (Java)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Port scanner (C#)
- Sockets problem (Java)
Other Threads in the VB.NET Forum
- Previous Thread: print code
- Next Thread: How to get source of Active IE Browser webpage. - VB or VB.net
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add arithmetic array assignment basic binary bing box button buttons center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel file-dialog firewall folder google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net networking opacity output pan peertopeervideostreaming picturebox picturebox1 plugin port print printpreview problemwithinstallation project record reports" reuse save savedialog serial server sorting sql storedprocedure string temp text textbox timer toolbox updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf





