I have create a client using VB.NET using Winsock 5.0 as a socket to communicate with the server which I did it in java.

The problem is that for terminating the client first send a termination request to the server and the server grants the permit and the server send back the response but on my client side it do indicate that the server has sent something because the message box will show but it has nothing. Here is what happens in a flow.

Client Send --(exit) message

And when the server receive this will know that the client is exiting but the client waits for the server response.

Server Send --(exit) message back to the client and but this is not being displayed on my client.

The problem is with the DataArrival

Here is what I have.

 Private Sub AxWinsock1_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles AxWinsock1.DataArrival
 Dim Server_Response As String
 End Sub

That is a VB.NET 2010 code

The VB5.0 is

 Private Sub TestServer_DataArrival(ByVal bytesTotal As Long)
 Dim Smsg As String
 TestServer.GetData Smsg
 End If

In VB 5.0 I did receive the message but in VB.NET I don't get nothing yes the Message box will popup but it will have nothing which means it go get the message but I don't know why the it not assigning it to the variable I've given it.

Anyone who can help me out thanks.

Recommended Answers

You might want to check out this code exsmple:

Jump to Post

All 2 Replies

Not working, I think the OP for that sample is using the newer versions of Winsock, I'm using 5.0 not 6.0 but in VB.NET 2010

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.