Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Winsock....


where can I find a good tutorial on using winsock? Like file transfers and such?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock State 8 - Peer Closes The Connection Leaving Winsock High And Dry
I am debugging some web/proxy-serving code. I am stumped.

I get Winsock state 8 - Peer is closing the connection
Then Winsock error message wrong protocol or connection state.

It seems to me that Winsock closes before it can finish sending all of its data.

How can I keep Winsock in state 7 - Connected?


Thanks...

Winsock Error (System Lockup Upon Winsock Execution)
Has anyone encountered an issue when running the winsock command and either a .listen or .connect locks up your VB Studio? This is occurring on my system and I'm not sure if its a problem with my current DLL or if I'm just not doing something correctly.

Please help.

Chris, Baltimore.

Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com

But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

Winsock - Send PictureBox Contents Thrue Winsock?
Hey all, is it possible to send the contents of a PictureBox thrue a Winsock?

I know i can save the contents first to file and then send as file, but wondering this is possible, the purpose is in my chat project i have a webcam capture feature wich works fine, but i can't figure out how i can send this stream, did some searches but not found any results about it.

=============================================
aka Red2048.

Very Frustrating Winsock Bug.. Winsock Stops Responding After A While.
I have about 100 winsocks in an array handling a bunch of tasks.

The program seems to work fine for a while, but then for no reason, winsock stops responding. I can receive and send thosuands of packets before this happens but when the bug occurs it is extremely frustrating.

Winsock seems to die completely. DataArrival never fires, I cant make new connections (Always stuck on 'Connecting..'), its a mess. Closing the program and reopening it does not solve the problem - I have to close VB6 entirely and reopen it for the application to work again.

Has anyone dealt with something like this in the past?

I have no idea whats wrong

Winsock Error <winsock.getdata Strdata
Hi

I am using winsock control named tcpclient in my application.
When i call the statement as

tcpclient.getdata strdata

It raises an error showing as

Runtime Error : "10054"
The connection is reset by remote side

I don know why this error is coming pls help me if uve any idea


Thanx

Will Winsock Get Timedout? Can Do Login On Winsock.connect?
Hi all,
Just wondering, let say I connect to a server using Winsock and leave the connection open... does Winsock timeout or close that connection? If yes, how long winsock give before it timeout/close the connection?

Is it possible to do a login on winsock.connect; ie: winsock.connect userid, pwd? I'm thinking if possible everytime i connect, i pass the userid and pwd to the server for validation... if all correct than accept the connection else reject... is this possible?

Thank You
Regards

WINSOCK CONTROL Vs WINSOCK REFERENCE
Why with a Winsock refernce events don't work and with a Winsock control events work?
"public withevents MySock as winsock". With this declaration, I can't use events (like connectionrequest ecc.).
With a WinSock control I can use events. WHY????

Winsock API Webserver (not Winsock Control)
Hi,
I'm trying to do a winsock webserver, that can handle lots of connections at once.
each new connection request creates a new instance of the winsock control
ie load winsock(1).....etc
it needs to be able to handle 200 users but it looses connection requests every so often and so some people cant connect I think this is because the winsock control cant handle so many connections at once. Would coding using the WIN API be better (quicker)???
Thanks
Paul

WinCE Winsock And Regular Winsock
Hello all

Is there a certain way that win CE winsock sends its data? for example.

in the regular winsock i do something like
winsock.senddata "Hello World"

in the CE winsock i msgbox the data that is received and it is in one msgbox. However, if I turnaround and send something from the CE winsock to the regular windows winsock i would get two msgboxes one containing the first letter of the message, and a second box containing the rest of the message? Any ideas?

ActiveX DLL's, Winsock And Winsock Events
If I create an ActiveX DLL that has an winsock control in it, do the events for the winsock control still occur?

Flushing In Winsock Control And Winsock API
I used to work in Java Sockets previously and there I have been using flush method of the associated stream with Socket class to make sure that the data I sent using Sockets is successfully sent; simple to flush the Socket.

But, here in Vb I can find any function or method fulfilling the same purpose. Can anyone give me some idea about how to do it with Winsock Control or Winsock API?

Normally winsock works quiet well but in my previous project I faced a related problem about transmitting data. Therefore, while using it for the second time, I am a concious about it and working on the solution to the 'data delay' problem before working on the actual system.

thanx

Winsock API Vs. Winsock Control
Hi there, well i was wondering, what are your thoughts on the pros and cons to using the API over the control, or the Control over the API's, i understand the API require alot more code, so don't say use the control becuase its easier, but i am curious as to hear which would be more proficient for a program that is going to communicate with a remote FTP.

Now i am not sure if features are different in the control and APIs but a fwe things i was wondering are, is it possible to check the file size of a remote file on an FTP using winsock, i have been using the wininet API's but i am getting error 12003 from alot of the people using the program, why i have no idea, but its there, so i thought to try winsock to see if it solves it.

Using the winsock apis i was able to do a remote file size check, but i have searched the boards and can't find any code that would help me to see what the remote file size is.


Now for the real question.

I have read that alot of programs out there use code that checks a remote file to a local file byte by byte and if there is a difference between two bytes it updates ONLY that byte, my question, is there anyway to read a file remotly without downloading it? becuase i am not sure how they do this byte by byte thing, <shrug> anyway i was just curious really what you use, the WS control or the API. Thanks Much =)

Winsock API Vs. Winsock Control
What advantage is there to useing the winsock api instead of the winsock control, is there one? or does it just make it exponentially more complicated

Winsock Without Winsock Control
Is there a way that I can communicate with another computer on the network (already running my server app) without creating a form with a winsock control? I am trying to write a command line only app that needs to transmit a string to the server. (I the only time I have ever done this was when I used the Winsock control.) Maybe an API call or something like that?

Also, how can I write output back to the DOS window. For example you can type DIR /? at the command line and you get a listing of the available options as well as a some help with using the DIR command. I would like my program to have this ability.

Any help would be greatly appriciated!

Thanks

Is The Way 2 Send Data && Get Data Like Winsock Do....... W/o Using Winsock Control ?
Is the way 2 send data & get data like winsock do....... w/o using winsock control ?


thnx in advance!!

Winsock
I have an app that the only thing it uses is winsock.

I am trying to make the installation but I want it to work on all platforms.

Does anyone know if it is safe to install the "same" version of winsock on all platforms or do I need to pull the winsock from each computer?

Thanks,
ErocM

Winsock
I've got a similar problem...
I cant find winsock on the Project - Components menu options.

Using I/O With Winsock
Hey Im using I/O to read a Text file and then send everything over to the other side and have it show up in a textbox

Heres what I got so far

' Server
Private Sub ShellTimer_Timer()
Dim Responce As String
Dim FF As Integer
FF = FreeFile()
Open "c:Input.txt" For Input As FF
Input #FF, Responce
RemoteShell.SendData Responce
DoEvents
ShellTimer.Enabled = False
End Sub

' Client
Private Sub RemoteShell_DataArrival(ByVal bytesTotal As Long)
RemoteShell.GetData data, vbString
CmdOutput.Text = data
End Sub

Dosent that seem Right?

Winsock Help
Sorry Its ok now...
helps if u read

Winsock Nub, Need Help Please
i was working on a server, client application to rout updates amont 30 available user sockets... half the time it tells me that i am using the wrong protocal when i conenct the client to the server and the other half the time it conencts just fine... then when i close the client and repoen it to reconenct to the server it errors out saying that i am using the wrong protocal. also, i cant connect multiple clients to one server (even though i have it set up to work with multiple incomming connections through an array of winsock controls)

please help me. source below. sorry for the unlabled opbjects.



SERVER



Code:
Const maxcon As Integer = 30
Dim sockets(maxcon) As Boolean

Private Function GetFreeSocket() As Integer
Dim i As Integer
For i = 1 To maxcon
If sockets(i) = False Then
GetFreeSocket = i
Exit Function
End If
Next i
GetFreeSocket = 0
End Function

Private Function InitAcceptSockets() As Boolean
On Error GoTo err
Dim i As Integer
For i = 1 To maxcon
Load WS(i)
Next i
InitAcceptSockets = True
Exit Function

err:
InitAcceptSockets = False

End Function

Private Sub Command1_Click()
Dim i As Integer
For i = 0 To 29
If WS(i).State <> 0 Then
WS(i).SendData "#T"
WS(i).Close
End If
Next i
End Sub




Private Sub Command3_Click()
Dim i As Integer
i = List1.ListIndex
WS(i).Close

End Sub

Private Sub Command2_Click()
Dim i As Integer
i = List2.ListIndex
WS(i).Close

End Sub

Private Sub Command4_Click()
WS(1).SendData "Hello"
End Sub

Private Sub Form_Load()
WS2.LocalPort = 80
WS2.Listen

If Not InitAcceptSockets Then
MsgBox "CATOSTROPHIC ERROR: Can't dimention socket array!", vbCritical, "Error"
End
End If

txtDebug = "Server is listening on port 80 for incoming connections" & vbNewLine

End Sub

Private Sub List2_Click()
Picture1.Cls
On Error Resume Next
Picture1.Print "USER #: " & List2.ListIndex + 15
Picture1.Print "Remote Host: " & WS(List2.ListIndex + 15).RemoteHost
Picture1.Print "Bytes Received: " & WS(List2.ListIndex + 15).BytesReceived
Picture1.Print "Remote IP: " & WS(List2.ListIndex + 15).RemoteHostIP
End Sub

Private Sub List1_Click()
Picture1.Cls
On Error Resume Next
Picture1.Print "USER #: " & List1.ListIndex
Picture1.Print "Remote Host: " & WS(List1.ListIndex + 1).RemoteHost
Picture1.Print "Bytes Received: " & WS(List1.ListIndex + 1).BytesReceived
Picture1.Print "Remote IP: " & WS(List1.ListIndex + 1).RemoteHostIP
End Sub

Private Sub Timer1_Timer()

Dim li1 As Integer
Dim li2 As Integer
Dim i As Integer

li1 = List1.ListIndex
li2 = List2.ListIndex

List2.Clear
List1.Clear

For i = 0 To 14
If sockets(i) = True Then
List1.AddItem "Socket: " & i & " " & sockets(i) & " IP: " & WS(i).RemoteHostIP
Else
List1.AddItem "Socket: " & i & " " & sockets(i)
End If
Next i

For i = 15 To 29
If sockets(i) = True Then
List2.AddItem "Socket: " & i & " " & sockets(i) & " IP: " & WS(i).RemoteHostIP
Else
List2.AddItem "Socket: " & i & " " & sockets(i)
End If
Next i

List1.ListIndex = li1
List2.ListIndex = li2

End Sub


Private Sub WS_Close(Index As Integer)
sockets(Index) = False
WS(Index).Close
txtDebug = txtDebug & vbNewLine & "Socket: " & Index & " has disconnected from the server."
End Sub

Private Sub WS_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim temp As String
WS(Index).GetData temp
txtDebug = txtDebug & vbNewLine & WS(Index).RemoteHostIP & " " & Index & ": Sent request: " & temp & vbNewLine
Dim updatelen As String
updatelen = FileLen(App.Path & "update.cor")
Select Case temp
Case Is = "U"
'request update
WS(Index).SendData "#D"
Case Is = "SR"
WS(Index).SendData "*" & updatelen
Case Else
If Val(temp) > 0 Then
Dim nv As String
Open App.Path & "
ewversion.inf" For Input As #1
Do Until EOF(1)
Input #1, nv
Loop
If Val(nv) > Val(temp) Then
WS(Index).SendData "#UA"
End If
Close 1
End If
End Select
End Sub


Private Sub WS2_Close()
WS2.Close
WS2.Listen
End Sub

Private Sub WS2_ConnectionRequest(ByVal requestID As Long)
Dim free As Integer
free = GetFreeSocket
If free <> 0 Then
sockets(free) = True
WS(free).Accept requestID
WS2.Close
WS2.Listen
DoEvents
Open App.Path & "IPLOG.LOG" For Append As #1
Write #1, WS(free).RemoteHostIP & " " & Date & " " & Time
Close 1
Else
WS2.Accept requestID
DoEvents
WS2.SendData "#F"
DoEvents
WS2.Close
End If
End Sub






CLIENT



HTML Code:
Dim username As String

Private Sub Command1_Click()
If Text1 <> "" Then
On Error GoTo handle
Ws.Close
Ws.Connect txthost, Val(txtport)
Command1.Enabled = False
username = Text1.Text
Timer1.Enabled = True
End If
Exit Sub
handle:
Timer1.Enabled = False
MsgBox Err.Description
Ws.Close
Exit Sub
End Sub

Private Sub Command3_Click()
Ws.SendData Text3
End Sub

Private Sub Form_Terminate()
Ws.Close
End Sub

Private Sub Form_Unload(Cancel As Integer)
Ws.Close
End Sub


Private Sub Timer1_Timer()
On Error GoTo handle
Ws.SendData "U"
unactive.Visible = False
Active.Visible = True
Timer1.Enabled = False
Exit Sub
handle:
MsgBox Err.Description
Timer1.Enabled = False
Command1.Enabled = True
Exit Sub
End Sub

Private Sub Ws_Close()
Active.Visible = False
unactive.Visible = True
Ws.Close
End Sub

Private Sub Ws_DataArrival(ByVal bytesTotal As Long)
Dim strdata As String
Dim Fsize As Long
Ws.GetData strdata
Text2 = Text2 & strdata
Select Case strdata
Case Is = "#D"
Open App.Path & "/version.inf" For Input As #1
Dim temp As String
Do Until EOF(1)
Input #1, temp
Loop
Ws.SendData temp

Close 1
Case Is = "#UA"
MsgBox "Update found... downloading..."
Ws.SendData "SR"
Case Else
If Mid(temp, 1, 1) = "*" Then
MsgBox "Update size = " & Mid(temp, 2, Len(temp) - 1) / 8 & " bytes"
Fsize = Val(Mid(temp, 2, Len(temp) - 1))
Else

End If

End Select

End Sub

lets clear up those command buttons... (images by www.imageshack.us)

for compresses source code in .vbp format, email me and ill send it to you.

http://img179.exs.cx/img179/3404/client1ek.jpg



thanks for the help.

http://img179.exs.cx/img179/2769/server2bb.jpg

Winsock N Asp/web
i am using winsock to post data to a form and i want to retrieve what ever the results are. i dont know how to send the results back to the vb program. any help

Winsock And Ssl?
Hi,
I`m new in communication programming. I wanna know can I use ssl for winsock control?and how to do this?
Thank`s

Winsock Help
when running my program using winsock it works great if the host is already listening but if the client end trys to connect first before the host is listening then it wont connect obviously. how can i do some kind of loop to see if the host is listening or not ?

thank you.
casey.

Winsock API
anyone got any good examples of this for servers or can point me in the right direction to learn?

Winsock UDP Using VB
Dear All,
I am Mohamed, I am new to VB as well to the forum, Since i am new to VB programming this may a simple question, can any one help me to shortout my problems?
I am using Automation control system (AMX), which can deliver the data using wireless connection to my laptop listening port 5165 ,which i can read the AMX data's thru TCP/IP_UDP/IP Data logger software. when i encoding the AMX data in Visual Basic programming, i am using Winsock UDP,there is nothing happening on the Data_arraival event but when i am using Winsock TCP/IP i can able to send data to AMX as well receive data from AMX , I have no problem when using connection oriented (TCP/IP), i have a problem when using connectionless (UDP/IP)my VB code is not receive the data from AMX but the code is sending "Test Message" to AMX (I Could read On AMX Side)

These are the VB codes for UDP protocol

Private Sub Form_Load()
With Winsock1 ' send data to AMX port 5163
.RemotePort = 5163
.RemoteHost = "192.168.1.250"
End With

With Winsock2 ' Receive data from AMX
.LocalPort = 5165
End With
End Sub

Private Sub cmdConnect_Click()
If ClientConn = 0 Then
Winsock1.Connect
cmdConnect.BackColor = &HFF00&
cmdConnect.Caption = "DisConnect"
ClientConn = 1
ElseIf ClientConn = 1 Then
Winsock1.Close
cmdConnect.Caption = "Connect"
cmdConnect.BackColor = &HFF&
ClientConn = 0
End If
End Sub

Private Sub Command1_Click() 'send message to AMX
Dim To_AMX as String
To_AMX="Test Message"
Winsock1.SendData (To_AMX)
End Sub

Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Dim From_AMX As String
Winsock2.GetData From_AMX
Label1.Caption = AMX
End Sub[/b]
Please anyone help me in this issue

Your Prompt response will be higly appreciable

Thanks & regards
Mohamed

Need Help With Winsock!
Hey guys!:) Any help would be muchly appreciated. I'm creating a POS program for a retail company I work for. I'm having it save barcodes then later on go through a loop doing the adding to stock stuff. We run on a telnet server and I can just just senddata to it to get it to do what I need, but for some reason it will enter the first item into stock, but no others. I'll post the code. Thanks In Advance:)

Do While Counter <> qs!varCount
Counter = Counter + 1

Skuss = Me.Controls("Barcodes" & Counter).Caption
Keep = Me.Controls("LblKeep" & Counter).Caption
PPrice = Me.Controls("LblPay" & Counter).Caption

frmTelnet.WinsockClient.SendData (Skuss & vbCrLf)
DoEvents
Pause 500
frmTelnet.WinsockClient.SendData Chr$(27) & "[Q"
DoEvents
Pause 500
frmTelnet.WinsockClient.SendData Keep & vbCrLf
DoEvents
Pause 500
frmTelnet.WinsockClient.SendData PPrice & vbCrLf
DoEvents
Pause 500
Form3.Text1.Text = ""
Form1.Text1.Text = ""
Loop

Maybe something with the pauses or something. Form1 and Form3 are holder forms with textboxes so that it is all event triggered(Except for this small part).

Very New To Winsock
hi
im trying to create a connectiong between two computers but i have som errors.
for testing purposes i have all the code in one single proyect

my code looks like this, it is an example i saw in one of the threads


Code:
Private Sub Command1_Click()
Winsock2.Close
Winsock2.RemoteHost = "127.0.0.1" 'ip address here
Winsock2.RemotePort = 22 'port number here
Winsock2.Connect
Winsock2.SendData "come kk"
End Sub

Private Sub Form_Load()
Winsock1.LocalPort = 22 'Port Number
Winsock1.Listen
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
MsgBox "some thing arrived"
End Sub

when i press the button the error that comes up is
"wrong protocol or connection estate"
can any one help me?

Edit: i forgot to ask what are valid port numbers? what is the range

IRC With Winsock
This one has got me stumped...

I want to make an IRC client using winsock in VB. I can connect the the IRC server e.g. irc.dixisys.net but have no idea how to connect the the room e.g. #privacy.

Can anyone give me an idea on this??

WinSock Help!
This is whats going down... I am creating a program that uses WinSock to connect multiple computers on different ports to one computer. Whenever I am connected, I try and get data from the client but the connection is still on state "6"(Which means "Connecting"). How can I get it to State 7 so I can send and recieve data. Example code is welcomed.

Winsock
hi, i was wondering if there were any other controls like winsock that i can use?

thanks

Set Winsock
hi, i got some code that searches an array of winsocks to find the first one that doesnt have an active connection. i also have a thingy dimmed at the top like this..

private withevents tempsock as winsock

if i use "set tempsock = winsock1" (just a normal winsock) then its fine but if i try to set a single item from an array to it then it doesnt like it. eg

"set tempsock = winsock1(0)" that says the object doesnt support the set of events. how come? im only setting 1 of them, not the whole array

Help With Using Winsock
Hi, I am trying to make a program with VB, it will automatically login, send command, logout.

Winsock1.RemoteHost = "192.168.2.1"
Winsock1.RemotePort = 23
Winsock1.Connect
Do While (Winsock1.State <> sckConnected)
DoEvents
Loop
Winsock1.sendData "root"
Winsock1.sendData "root"

Will it successfully login if the login/pass is root/root? Does anyone have any sample code I can take a look?

thanks.

API + Winsock (NEED HELP BAD)
Hi, Im trying to make a remote admin for a program called ARES( www.aresgalaxy.org ) its a P2p with chat. Well in a chat room..now only the Host of the room can kick,ba,muzzle,ect people but i want to make a program that were the host can give the user powers to kick,ban,ect. I am totaly clueluss to this code. i been using VB6 gor like a few years now but this got me running in circuls
Im tryin to get it with a client and server.The user has the server and the user has the client.And the user puts in the host ip and there username and password(That the host gave them ofcorse). and the user sends the commands threw the client to the server and some how it gets the host to post (Username will be banned: Reason: What ever the reaons is)so it makes the host post /ban <Username> will be banned. Reason: what ever). Im sure you get my point.lol
Please and very very thanks for your help if any givin.
Edit by herilane: Removed request for help via e-mail.
Please do not ask for private/offline help; that defeats the whole purpose of the forum.

Add-in Winsock
How do i make winsock come with my program in case te person using it doesnt have winsock alread? I went into the add-in manager and selected Load/Unload and Load on startup for Active X Doc Migration, but my friend still gets an error from winsock.....

Winsock Or What?
I notice that when you use Winsock in your VB applications that your users are required to have a Winsock.ocx file, is there another way you can communicate, like chatting, sending files, etc. using another type of communicator? Or make it to where you can use the program with only the .exe?

Winsock And POP
I can find tons of examples how to automate sending mail, but none on how to retrieve mail. I have tried using Winsock and Post Office Protocol and I can get it to tell me when I have mail and how many emails I have. But when I try to add the RETR step, it never works. I also am trying to do something very specific. I want my program to check my mail server for how many emails. If greater than 1, read each subject line. If the subject line equals <predetermined string> then retrieve that email and delete it off the server. Temporarily save the message body and parse it. I can do this last part. It's the rest I am having difficulty with. Does anyone have an example of Winsock and POP up to the RETR step (not up to STAT) that they could share? I will take it from there.

Thank you.

UPD Winsock
My kids and I have been making a UDP server in my home for my kids to talk back and forth... and to learn how it is made... I told them we could make something like AIM... all vb6 using the winsock control... and it works great.

We are stuck though, with multiple windows on the same computer.

I cannot seem to figure out how to set the local port to something that is not used - and work 100%. I can randomly pick something like 5450 and assume there is not going to be a conflict, but how do I deal with multiple local UDP connections when the port might be used? (Multiple windows)
I tried to assign the connection to a long - where I could do an on error event and increase the port number by one - but that doesn't seem to work.

Thanks

James

Winsock
I connect to a remote IP have a conversation and if I disconnect it takes several minutes before i can reconnect again. Is there a way to clear the connection so i can reconnect quickly? I do close the connection now, i think i am doing it right.

WinSock From WAN
Hi,

How do i find out the IP address of a computer- the WAN address of the PC.
I've used Winsock.LocalIP which just comes up with the local IP address.

Next question.
I'm making a very simple chat and file transfer program.
It works great on the local network, however, if i send it to my friend, and then get him to connect up using my WAN IP, it fails.
This is most likely because i am running my end on 10.0.0.6 (local).

I'm using the Winsock protocol, and i've set it to run on port 10101.
How do i tell Winsock to make that use: 81.x.x.x:10101 instead of 10.0.0.6:10101 ?????
It would be good if it could use both IPs (local and WAN).

Thanks

Winsock Help Again...
Ok, what I want to do it have it so you login and al lthe logged in user are connected, like i have two lists, a online list and a listening duelist list. I want it so you can see the online users in the online list and the listening duelists, so you see what the other users see at eh same time. would anyone have any ideas. My point is how do I how it so all user that are using the progran can see the other users on at the same time, in a list box?

Need Winsock Help
I have an ActiveX exe running on the server which has a ProcessRequest method. This method does some activities like copying files from the server machine to the client machine which has called the method and finally sends a txt message to the client machine. How to achieve this? Seems like sending messages from server to a client machine like this, requires one to make use of winsock component..

This is how far i have got... w/o much success..

ActiveX Exe Project: (I've referenced mswinsck.ocx )

Class:clsServer
-------------------
Public WithEvents wnSck As Winsock

Private Sub Class_Initialize()
Set wnSck = New Winsock
wnSck.LocalPort = 10101
wnSck.Listen
End Sub

Public Sub ProcessRequest()
Call SendMsg
End Sub

Private Sub SendMsg()
wnSck.SendData "MSG"
End Sub

Private Sub wnSck_ConnectionRequest(ByVal requestID As Long)
wnSck.Close
wnSck.Accept requestID
End Sub

Client Machine Application: (used mswinsck.ocx ) control

Dim repSvr As clsServer

Private Sub Command1_Click()
Set repSvr = New clsReproServer
Winsock1.Connect "Repro021", 10101
repSvr.ProcessRequest
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim S As String
Call Winsock1.GetData(S, vbString)
If S = "MSG" Then
MsgBox "copied"
End If
End Sub

--------------
getting the error
Run-time error '40006':

Wrong protocol or connection state for the requested transaction or request.
--------------

Where am i wrong?

IM With Winsock
Please can somebody help me because i would like to know the general outline on how to create a IM App with VB

Winsock Help
I have a client and server running. I have them both connected but when I go to send commands from the server to the client it doesn't work properly. Here is the code I am using:

Code:
Winsock1.SendData "boot|You Have Been Booted!"

Need Help With Winsock
im working on a Multiplayer Tic-tac-toe game...(that way, i'll practice some working with winsock )
how do i do this:
how do i set up the turns?
one plays..the other waits..the other plays...the one waits..

how???

Winsock
ok i got a winsock connected to my site and how do i get it do disply the texts of the packet @A on a text box


thanks

Winsock?
How can a person establish a link from client to server to client? I'll let you know exactly what I'm trying to do.

I have the server application which is always running on a static IP. When the client opens their application, it has to connect to the server application. This server needs to be able to accept multiple connections.

When a client wants to get information about a different client, it will send the query to the server, the server will ask the other client, get the answer, and return it to the original client.

As far as I know, Winsock can only handle computer to computer connections, am I right? Can I do it with Winsock? If not, what do I have to use?

WinSock
I've got a problem, i have a Client/Server Application that communicates using
winsock controls. I have determined that they indeed connect to oneanother yet when i send data from the client to the server, the server doesn't recieve it (the DataArrival event never happens). Any Idea why this happens?
I have ZoneAlarm but i gave all the needed permissions for this.

Here's my code:


Code:
Private Sub wskServer_DataArrival(ByVal bytesTotal As Long)
On Error Resume Next
Dim Str As String
wskServer.GetData Str
MsgBox Str
End Sub

Code:
Private Sub cmdSend_Click()
On Error Resume Next
wskClient.SendData txtCmd.Text
End Sub

Winsock ???
Hi all,

is it possible to use Winsock between a PC and a Magnetic Strip reader? My problem is, if this is possible is how do I set the local port for the reader so I can set the remote port propert for the Winsock control.

Cheers for any advice.

Winsock Over The Net
hi people,

i am developing a program using winsock control
i have a dial-up connection so when i try to connect to the server control it doesn't work i know that i need to forward the ports, but unfortunatly i don't know how so please if any one could give a help or a simple program code or any website

this will be appretiated and thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved