|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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 Jo***@aol.com schrieb:
> I am new to vb.net Why do I get this error statement Hi,> > > systemSocket.Bind(48612) > > > Error3 Overload resolution failed because no accessible 'Bind' accepts > this number of arguments 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. 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 Jo***@aol.com wrote:
> Why do I get this error statement Because there is no "Bind" method on the systemSocket object that takes > systemSocket.Bind(48612) > Overload resolution failed because no accessible 'Bind' accepts > this number of arguments only one, Integer argument. If you haven't already, install MSDN; it is almost /impossible/ to get anywhere without it. HTH, Phill W. Jo***@aol.com wrote:
> I am new to vb.net Why do I get this error statement Because, as the error message says, there isn't a version of> systemSocket.Bind(48612) > Error3 Overload resolution failed because no accessible 'Bind' accepts > this number of arguments 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.
what is a static property and a cursor question
Not understanding simple concept Updating Datagridview Data entry into ComboBox VB.NET debug error Need help with CreateFile API function mutex Installed version of Access need convert a value (integer) into bytearray with bits 0-31 Add usercontrol to listbox |
|||||||||||||||||||||||