I am trying to create a socket and I am getting an error on the line:
Dim sock As New Socket(AddressFamily.InterNetwork ,SocketType.Rdm,ProtocolType.Udp)
it says that The support for the specified socket type does not exist in this address family
Can someone please point out where I am going wrong with my code (See Below).
Thanks
Function BroadCastAlarm(ByVal msg)
Const sckTCPProtocol = 0
Const sckUDPProtocol = 1
Dim buffer As Byte()
Dim IP_buff As Byte()
IP_buff = System.Text.Encoding.UTF8.GetBytes("255.255.255.255")
Dim str, nTime
Console.WriteLine("Creating Socket")
Dim end_point As New System.Net.IPEndPoint(System.Net.IPAddress.Parse("255.255.255.255"), 19989)
Dim sock As New Socket( AddressFamily.InterNetwork ,SocketType.Rdm, ProtocolType.Udp)
nTime = fixDate(FormatDateTime(Now), "yyyy-mm-dd") + "T" + fixTime(FormatDateTime(Now), "hh:mm:ss") + "-04:00"
str = "<?xml version=""1.0""?>" + vbCrLf + _
"<NOTIFY_ALL_FORMS xmlns:xsd="" xmlns:xsi="" + vbCrLf + _
" <created>" + nTime + "</created>" + _
" <database_table>@system_alert</database_table>" + vbCrLf + _
" <primary_key_field>" + msg + "</primary_key_field>" + vbCrLf + _
" <primary_key_value>-1</primary_key_value>" + vbCrLf + _
" <notify_Type>UPDATE</notify_Type>" + vbCrLf + _
" <from_host>AJB-ISA</from_host>" + vbCrLf + _
"</NOTIFY_ALL_FORMS>"
buffer = System.Text.Encoding.UTF8.GetBytes(str)
Console.WriteLine("Connecting")
sock.Connect(end_point)
Console.WriteLine("Sending")
sock.Send(buffer)
Console.WriteLine("closing")
sock.Close()
Console.WriteLine("Closed")
sock = Nothing
End Function
Dim sock As New Socket(AddressFamily.InterNetwork ,SocketType.Rdm,ProtocolType.Udp)
it says that The support for the specified socket type does not exist in this address family
Can someone please point out where I am going wrong with my code (See Below).
Thanks
Function BroadCastAlarm(ByVal msg)
Const sckTCPProtocol = 0
Const sckUDPProtocol = 1
Dim buffer As Byte()
Dim IP_buff As Byte()
IP_buff = System.Text.Encoding.UTF8.GetBytes("255.255.255.255")
Dim str, nTime
Console.WriteLine("Creating Socket")
Dim end_point As New System.Net.IPEndPoint(System.Net.IPAddress.Parse("255.255.255.255"), 19989)
Dim sock As New Socket( AddressFamily.InterNetwork ,SocketType.Rdm, ProtocolType.Udp)
nTime = fixDate(FormatDateTime(Now), "yyyy-mm-dd") + "T" + fixTime(FormatDateTime(Now), "hh:mm:ss") + "-04:00"
str = "<?xml version=""1.0""?>" + vbCrLf + _
"<NOTIFY_ALL_FORMS xmlns:xsd="" xmlns:xsi="" + vbCrLf + _
" <created>" + nTime + "</created>" + _
" <database_table>@system_alert</database_table>" + vbCrLf + _
" <primary_key_field>" + msg + "</primary_key_field>" + vbCrLf + _
" <primary_key_value>-1</primary_key_value>" + vbCrLf + _
" <notify_Type>UPDATE</notify_Type>" + vbCrLf + _
" <from_host>AJB-ISA</from_host>" + vbCrLf + _
"</NOTIFY_ALL_FORMS>"
buffer = System.Text.Encoding.UTF8.GetBytes(str)
Console.WriteLine("Connecting")
sock.Connect(end_point)
Console.WriteLine("Sending")
sock.Send(buffer)
Console.WriteLine("closing")
sock.Close()
Console.WriteLine("Closed")
sock = Nothing
End Function