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

System.Net.Sockets & Winsock 6

P: n/a
I'm having a tough time getting System.Net.Sockets to work with a server
that's based around Winsock 6.0. For many reasons I can't write a new server
because the server handles a number of client formats.

I'm writing a new client that should be able to connect to the Winsock-based
server. However, I can't get them to talk to each other. The server hears
and understands what System.Net.Sockets is saying, but when it tries to
respond System.Net.Sockets just acknowledges the connection.

Whatever I do (tcpClient, Socket, bufferbased or streambased) the app that
uses the socket-class just reports that the connection is just a mere
connection but that there is no data availible.

----
Dim tcpListen as New TcpListener(13301)
Dim client As Socket
----
Private Sub PollTimer_Elapsed(ByVal sender As System.Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles PollTimer.Elapsed

Dim datBytes() As Byte

Dim datStr As String

Dim numBytes As Integer

Try

If tcpListen.Pending = True Then

client = tcpListen.AcceptSocket

If client.Poll(1, SelectMode.SelectRead) = True Then

numBytes = client.Available

client.Receive(datBytes)

End If

End If

client.Close()

Catch exc As Exception

Console.WriteLine(exc.Message)

Console.WriteLine(exc.StackTrace)

Console.WriteLine(exc.TargetSite)

Console.WriteLine(exc.GetType)

End Try

End Sub

---
Has anyone been into this before? Any links, pointers to articles or
tutorials?

Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.