我想写个ipx协议下的网络通讯程序
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim mes As Byte() =
System.Text.Encoding.ASCII.GetBytes(TextBox1.Text)
Dim adressefamily As
Net.Sockets.AddressFamily = Net.Sockets.AddressFamily.Ipx
Dim socktype As Net.Sockets.SocketType
= Net.Sockets.SocketType.Dgram
Dim protokolltype As
Net.Sockets.ProtocolType = Net.Sockets.ProtocolType.Ipx
Dim send As New
Net.Sockets.Socket(adressefamily, socktype, protokolltype)
Dim local As Net.IPAddress =
Net.IPAddress.Any
Dim ep As New Net.EndPoint(local, 2000)
Try
send.Bind(ep)
Catch ed As Exception
MsgBox("error" & ed.ToString)
End Try
这是我写的,我想用socket send作为服务器端,我怎样绑定现在我自己网络ipx地址.
我按照上面的方法,错误原因是我用的endpoint的ip地址和我所选择的协议不兼容.我应该怎样定义我的endpoint,能让它指向我的本地ipx地址?
跪求答案,我时间不多了.