469,890 Members | 2,158 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Listening socket still listen after first connection

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
1 1339
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.

Similar topics

reply views Thread by Hameed Khan | last post: by
2 posts views Thread by Christian von Essen | last post: by
2 posts views Thread by Richard Gass | last post: by
4 posts views Thread by Engineerik | last post: by
10 posts views Thread by ThunderMusic | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.