[Gambas-user] gb3 - "Too many arguments" when binding UDP socket to port

Kevin Fishburne kevinfishburne at ...1887...
Sun Dec 12 00:42:45 CET 2010


   Code looks like this:
   ' General declarations.
   Public server_port As Integer ' UDP port server listens on and client sends
   data to.
   Public server_ip As String    ' IP address of the server that client sends
   data to.
   Public mode As String         ' Mode to run game in ("client", "server").
   Public  udp  As UdpSocket       ' UDP socket for client/server network
   communication.
   Public data As String         ' Stores incoming UDP data.
   Public Sub Initialize()
     ' Network initialization.
     ' Create the UDP socket.
     udp = New UdpSocket As "UDP"
     ' Bind the socket to the appropriate port.
     If udp.Status <= Net.Inactive Then
       If mode = "server" Then
         udp.Bind(server_port)
          Console.Say(Time  &  "  -  Mode: " & mode & ", Server Port: " &
   server_port)
       Endif
       If mode = "client" Then
         udp.Bind(0)
         Console.Say(Time & " - Mode: " & mode & ", Server IP Address: " &
   server_ip & ", Server Port: " & server_port)
       Endif
     Endif
   End
   I'm currently trying to convert my app from gb2 to gb3, so this is working
   in gb2. "udp.Bind(0)" returns the error, and though I haven't tested it yet
   I'm thinking that "udp.Bind(server_port)" will also return the same error.
   Any ideas what I'm doing wrong?
-- 
Kevin Fishburne
Eight Virtues
www: [1]http://sales.eightvirtues.com
e-mail: [2]sales at ...1887...
phone: (770) 853-6271

References

   1. http://sales.eightvirtues.com/
   2. mailto:sales at ...1887...



More information about the User mailing list