Results 1 to 6 of 6

Thread: Help setting socket protocol

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Help setting socket protocol

    I have a small server daemon running on linux, the socket for the server is a SOCK_DGRAM, the protocol is ETH_DISCO_P (defined by me). I want to be able to send messages to this server from visual basic.
    I cannot seem to set the protocol of the socket.

    I have defined "Private Const ETH_P_DISCO As ProtocolType = &H88AD" same as in my server daemon.

    When I try to open a socket like
    "_socket = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ETH_P_DISCO)"
    i get a socket exception; Message "The requested protocol has not been configured into the system, or no implementation for it exists"

    How can i configure this protocol, or maybe some one know a better way to do this. The server and client are both working from linux. Can this even be done from VB?

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Help setting socket protocol

    use Winsock for VB6 sockets on a TCP or UDP connection, is your linux socket TCP based? you can use PHP sockets on a linux server on TCP protocol, which you can communicate with VB
    Chris

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Re: Help setting socket protocol

    my linux socket is create by a call to socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_DISCO), so it is a datagram socket, kind of like UDP (if it were udp, the third arg in socket call would be 0 or IPPROTO_UDP). The server's socket protocol is ETH_P_DISCO. Can I create a socket with VB whose protocol type is user defined. How would I go about doing that?

    forgive my ignorance, what is a PHP socket. do you mean use PHP as the programming language? The server is already written in C.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help setting socket protocol

    Quote Originally Posted by gmcc
    forgive my ignorance, what is a PHP socket.
    PHP Sockets

  5. #5
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Help setting socket protocol

    PHP sockets are not great if you want to maintain a connection for a long period though, as they have to be started by a web browser, and the broswer has to stay open untils your done witht he connection. But for short connections they are great
    Chris

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Re: Help setting socket protocol

    PHP sockets are just TCP/UDP socket written in PHP, I am using visual basic for the client and C for the server. The server is listening on his network interface for datagram packets of type ETH_P_DISCO which in this case is a replacement for UDP, there is no ip address in my protocol just ethernet addresses.

    I would like to be able to send this kind of packet using a visual basic System.Net.Sockets.Socket

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width