Multi User chat.

conversion from c# to

Page 1 of 1

1 Replies - 6325 Views - Last Post: 29 September 2009 - 11:25 AM Rate Topic: -----

#1 crzyone9584   User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 201
  • Joined: 22-April 08

Multi User chat.

Posted 29 September 2009 - 11:21 AM

I'm looking at the following tutorial.


My problem is its in c#. I have used this site to change it from c# to


I havnt plugged in any code except for the server part.

IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 8000);
Socket newsock = Socket(AddressFamily.InterNetwork,
				   SocketType.Stream, ProtocolType.Tcp);
Socket client = newsock.Accept();

That is teh c# for server.

It went to

Dim ipep As New IPEndPoint(Ipaddress.Parse(""), 8000)
Dim server As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

I put into VS 2008 and had some errors. i fixed them by importing

Imports System.Net.Sockets
Imports System.Net

I still have one error which i don't know how to fix.

Dim newsock As Socket = Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

The error is on the socket that is after =

'Socket' is a type and can not be used an an expression.

I was how to go about and fixing this. As im sure ill run into this type of error more while converting the client side of the application.

Is This A Good Question/Topic? 0
  • +

Replies To: Multi User chat.

#2 motcom   User is offline

  • D.I.C Lover
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: Multi User chat.

Posted 29 September 2009 - 11:25 AM

the problem is that it has a constructor and needs to be declared as new and the statement for this is

Dim newsock As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)


Dim newsock As Socker =  New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1