|
-
Nov 19th, 2001, 10:13 AM
#1
Thread Starter
Member
Simple Winsock Question
Hey,
I'm trying to use this winsock control. And I get so far as this.
On the receiving computer it performs the Connection request.
But the DataArrival condition never executes..
I'm just following that article on winsock controls.. i can send the code if it helps.
-
Nov 19th, 2001, 10:26 AM
#2
Lively Member
I take it you are listening to the right port?
Posting some code would help, yes.
-
Nov 19th, 2001, 10:27 AM
#3
Lively Member
The server app must send something, for the client app to recieve.
-
Nov 19th, 2001, 12:34 PM
#4
Frenzied Member
If you are using the example in Karl Moore's article, the problem is with these 2 lines of code:
Code:
Winsock1.SendData (txtMessage.Text)
Winsock1.Close
You must allow the send enough time to complete before closing the socket.
If you are interested, I can send you an example client/server app that I wrote to help new winsock users. It is heavily commented, it displays connection states in the form's caption and results in form labels. It also demonstrates how to pass records (aka UDTs) and how to set a time limit when waiting on replys. The server uses 2 socket controls, 1 to listen and one for connecting & sending/receiving data.
-
Nov 19th, 2001, 12:48 PM
#5
Hyperactive Member
I havent seen the code, so i am gonna do this from a general case that i use. Are you getting the data using the winsock1.getdata command?
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim strDataStream as String
Winsock1.getData strDataStream
MsgBox strDataStream
End Sub
of course you can do just about anything with the strDataStream but thats whats coming accross the connection.
..::[ kleptos]::..
- Database Administrator (MSSQL 2000)
- Application Developer (C#)
- Web Developer (ASP.NET)

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|