Hi DW

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
 AxWinsock1.GetData(Server_Response)
 MsgBox(Sever_Response)
 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
 MsgBox(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.

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.