public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: UNIX-Style sockets with gnu-win32
@ 1997-03-19  5:25 Sergey Okhapkin
  0 siblings, 0 replies; 4+ messages in thread
From: Sergey Okhapkin @ 1997-03-19  5:25 UTC (permalink / raw)
  To: gnu-win32, 'interrupt reQuest'

interrupt reQuest wrote:
>    Well, what I have done is used a test server i wrote in unix with
>   gcc... it works fine in unix, the socket binds, listens and accepts
>   connections... i have compiled it with gnuwin32, and proceeded the
>   accept, bind etc... with cygwin32_... it compiles, but the socket
>   will
>   not accept and it is not bound.. here is an attatchment of the code
>   i
>   used... if you have any simple working code as an example, id
>   appreciate
>   it, as i need all the help i can get :P
> 

>           server_address.sin_port = 1234;

You should write server_address.sin_port = htons(1234);.

-- 
Sergey Okhapkin
Moscow, Russia
Looking for a job.


-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UNIX-Style sockets with gnu-win32
       [not found]   ` <332E4F62.1D36@bc1.com>
@ 1997-03-18 16:07     ` interrupt reQuest
  0 siblings, 0 replies; 4+ messages in thread
From: interrupt reQuest @ 1997-03-18 16:07 UTC (permalink / raw)
  To: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2206 bytes --]

  Ron G. Minnich wrote:

    what's the specific problem? i've not had much trouble other than
    the
    select-on-console-and-sockets problem.

    ron

    Ron Minnich                |"I would point them out but ...
    rminnich@sarnoff.com       |  I have no hands." -- Coconut Monkey
    (609)-734-3120             | (see CM at
    www.pcgamer.com/coconut.html)
    ftp://ftp.sarnoff.com/pub/mnfs/www/docs/cluster.html

   Well, what I have done is used a test server i wrote in unix with
  gcc... it works fine in unix, the socket binds, listens and accepts
  connections... i have compiled it with gnuwin32, and proceeded the
  accept, bind etc... with cygwin32_... it compiles, but the socket
  will
  not accept and it is not bound.. here is an attatchment of the code
  i
  used... if you have any simple working code as an example, id
  appreciate
  it, as i need all the help i can get :P

      ---------------------------------------------------------------
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <stdio.h>
  #include <netinet/in.h>
  #include <arpa/inet.h>

  main()
  {

          int server_sockfd, client_sockfd;
          int server_len, client_len;
          struct sockaddr_in server_address;
          struct sockaddr_in client_address;

          server_sockfd = cygwin32_socket(AF_INET, SOCK_STREAM, 0);

          server_address.sin_family = AF_INET;
          server_address.sin_addr.s_addr =
  cygwin32_inet_addr("207.34.139.51");
          server_address.sin_port = 1234;
          server_len = sizeof(server_address);
          cygwin32_bind(server_sockfd, (struct sockaddr
  *)&server_address, server_len);

          cygwin32_listen(server_sockfd, 5);

          printf("Server waiting\n");
          while(1) {
                  char ch;
                  client_sockfd = cygwin32_accept(server_sockfd,
  (struct sockaddr *)&client_address, &client_len);
                  read(client_sockfd, &ch, 1);
                  ch++;
                  write(client_sockfd, &ch, 1);
                  close(client_sockfd);
             }
  }



-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: UNIX-Style sockets with gnu-win32
  1997-03-17 15:25 interrupt reQuest
@ 1997-03-18  8:25 ` Ron G. Minnich
       [not found]   ` <332E4F62.1D36@bc1.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Ron G. Minnich @ 1997-03-18  8:25 UTC (permalink / raw)
  To: interrupt reQuest; +Cc: gnu-win32

what's the specific problem? i've not had much trouble other than the 
select-on-console-and-sockets problem.

ron

Ron Minnich                |"I would point them out but ...
rminnich@sarnoff.com       |  I have no hands." -- Coconut Monkey
(609)-734-3120             | (see CM at www.pcgamer.com/coconut.html)
ftp://ftp.sarnoff.com/pub/mnfs/www/docs/cluster.html 


-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* UNIX-Style sockets with gnu-win32
@ 1997-03-17 15:25 interrupt reQuest
  1997-03-18  8:25 ` Ron G. Minnich
  0 siblings, 1 reply; 4+ messages in thread
From: interrupt reQuest @ 1997-03-17 15:25 UTC (permalink / raw)
  To: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

To anyone who can help =]

    I desperatly need a unix style server example in gnu-win32... i have

tried using a server i designed with gcc in unix, with all of the socket

commands proceeded with cygwin32_, but had no luck! please help me
out!: P

            Thanks,    irQ

-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-03-19  5:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-19  5:25 UNIX-Style sockets with gnu-win32 Sergey Okhapkin
  -- strict thread matches above, loose matches on Subject: below --
1997-03-17 15:25 interrupt reQuest
1997-03-18  8:25 ` Ron G. Minnich
     [not found]   ` <332E4F62.1D36@bc1.com>
1997-03-18 16:07     ` interrupt reQuest

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).