By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,550 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

Listening socket still listen after first connection

P: n/a
Hi, i have a socket that i use to listen for a connection. there can be any
number of connections. when testing my socket, it sees the first connection,
then no others. i call the BeginAccept() method again, but it doesnt see any
other connections. heres the code...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim ep As New IPEndPoint(ipHome, PORT)

Try

socListen.Bind(ep)
socListen.Listen(50)
socListen.BeginAccept(AddressOf UserLogingIn, Nothing)

Catch ex As Exception

Call WriteError("Button1_Click", ex)

End Try

End Sub

Private Sub UserLogingIn(ByVal ar As IAsyncResult)

Try

Dim soc As New Connection

soc.soc = socListen.EndAccept(ar)
ReDim soc.buffer(4095)

socListen.BeginAccept(AddressOf UserLogingIn, Nothing)

soc.soc.BeginReceive(soc.buffer, 0, soc.buffer.Length,
SocketFlags.None, AddressOf UserSentSignOnInfo, soc)

lstConnected.Add(soc)

Catch ex As Exception

Call WriteError("UserLogingIn", ex)

End Try

End Sub
Connection is a structure of a byte array, socket, and name. all variables
have values, etc. VS2005. thanks

--
-iwdu15
Dec 29 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
never mind, it was a problem with my client application. thanks anyway
--
-iwdu15
Dec 29 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.