Newbie

J

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
 
N

Norman Chong

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.
 
M

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/d...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


(e-mail address removed) schreef:
 
P

Phill W.

Why do I get this error statement

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.
 
B

Branco Medeiros

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top