Home All Groups Group Topic Archive Search About
Author
27 Nov 2006 11:46 AM
Jorge
I am new to vb.net Why do I get this error statement


systemSocket.Bind(48612)


Error3 Overload resolution failed because no accessible 'Bind' accepts
this number of arguments

Author
27 Nov 2006 1:46 PM
Norman Chong
Jo***@aol.com schrieb:

> I am new to vb.net Why do I get this error statement
>
>
> systemSocket.Bind(48612)
>
>
> Error3 Overload resolution failed because no accessible 'Bind' accepts
> this number of arguments

Hi,

systemSocket.Bind(...) doesn't have any parameters or needs more than
one.

Example 1:
String.Equals(aString as String, bString as String) needs 2 String
objects as parameter - If one of them is missing, then you get this
error

Example 2:
Console.Read() doesn't have any parameters - If you call it with a
parameter, then you get this error too.
Author
27 Nov 2006 1:53 PM
Michel van den Berg
If you post like this, people don't know what kind of object your
systemSocket is. Next time please post more code (eg the declaration of
systemSocket).

Betting that systemSocket is a Socket object, have a look at the
following:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketssocketclassbindtopic.asp

The parameter needed by Bind is an EndPoint (click on it to see what if
is).
A more specific EndPoint could be an IPEndPoint
(http://msdn2.microsoft.com/en-us/library/system.net.ipendpoint.aspx)

Because I don't know what you would like to achieve I can't make any
recommendations, but from what I guess you want is something like:

Dim ipHostAddress as IPAddress = IPAddress.Parse("192.XX.XX.XXX")
Dim localEndPoint as new IPEndPoint(ipHostAddress, 0)

systemSocket.Bind(localEndPoint)

Let me know if this is what you want


Jo***@aol.com schreef:

Show quoteHide quote
> I am new to vb.net Why do I get this error statement
>
>
> systemSocket.Bind(48612)
>
>
> Error3 Overload resolution failed because no accessible 'Bind' accepts
> this number of arguments
Author
27 Nov 2006 2:06 PM
Phill W.
Jo***@aol.com wrote:
> Why do I get this error statement

> systemSocket.Bind(48612)

> Overload resolution failed because no accessible 'Bind' accepts
> this number of arguments

Because there is no "Bind" method on the systemSocket object that takes
only one, Integer argument.

If you haven't already, install MSDN; it is almost /impossible/ to get
anywhere without it.

HTH,
    Phill  W.
Author
27 Nov 2006 2:50 PM
Branco Medeiros
Jo***@aol.com wrote:
> I am new to vb.net Why do I get this error statement
> systemSocket.Bind(48612)
> Error3 Overload resolution failed because no accessible 'Bind' accepts
> this number of arguments

Because, as the error message says, there isn't a version of
Socket.Bind() that accepts a single integer as parameter. "Bind" needs
both the interface address and the port number to bind to, which is
given to the socket by an IPEndPoint.

If you're crafting a listening server, you may actually use

  systemSocket.Bind( _
    New IPEndPoint(IPAddress.Any, 48612))

And the system will setup a socket linstening from address "0.0.0.0",
which will listen from each available interface (or so it seems, I'm
not sure about that =) ).

HTH.

Regards,

Branco.