[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] lseek funktionaliitet på en socket.



  Article: <sslug@sslug>
  Date:    Wed, 09 Jun 1999 19:00:39 +0200
  Author:  Joachim Holst <sslug@sslug>

> 
> Har du kollat i Linux Programming Guide (hänger med RedHat) som finns på
> nätet ??
> 
> Står en del om det i kapitel 6. 
> 

IPC är bra nog när man inte behöver kommunicera med TCP/IP, men det är
det jag vill (jag kanske var oklar).


Förtydligande:


struct sockaddr_in address;

socket_fd = socket(AF_INET, SOCK_STREAM, 0);
address.sin_family = AF_INET;
address.sin_addr.s_addr = inet_addr("192.168.0.4");
address.sin_port =  htons(5454);

len = sizeof(address);
connect(socket_fd, (struct sockaddr *)&address, len);

write(socket_fd, buffer, sizeof(buffer));
read(socket_fd, buffer, 10); /* 10 bytes är bara en liten del av vad som
                                är möjligt att läsa */
    if ......
         ......
lseek(socket_fd, 0, SEEK_END);
write(socket_fd, buffer, sizeof(buffer));
read(socket_fd, buffer, 10);
    if ......
         ......
.....
.....

close(socket_fd);


Hälsn,
Magnus.



--
Magnus Sjögren <sslug@sslug>




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *