[Gambas-user] gb3 - "Too many arguments" when binding UDP socket to port
Ron
ron at ...1740...
Sun Dec 12 09:51:02 CET 2010
Syntax has changed in Gb3. See here for my Gambas2-Gambas3 scrapbook notes..
http://www.domotiga.nl/wiki/Gambas/Gambas3#UdpSocketSyntaxChange
Happy porting!...
Regards,
Ron_2nd.
On Sun, Dec 12, 2010 at 12:42 AM, Kevin Fishburne
<kevinfishburne at ...1887...> wrote:
>
> 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...
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list