version 1.18, 2004/11/23 00:02:55 |
version 1.20, 2005/07/03 11:08:54 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/plugin/sm1Socket.c,v 1.17 2004/02/25 23:14:35 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/plugin/sm1Socket.c,v 1.19 2005/06/16 05:07:24 takayama Exp $ */ |
/* msg0s.c */ |
/* msg0s.c */ |
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/socket.h> |
#include <sys/socket.h> |
#include <sys/time.h> |
#include <sys/time.h> |
Line 162 struct object KsocketConnect(struct object obj) { |
|
Line 163 struct object KsocketConnect(struct object obj) { |
|
/* [ integer socketid ] |
/* [ integer socketid ] |
[ integer newsocketid ] */ |
[ integer newsocketid ] */ |
struct object KsocketAccept(struct object obj) { |
struct object KsocketAccept(struct object obj) { |
struct object obj1; |
struct object obj1 = OINIT; |
struct object obj2; |
struct object obj2 = OINIT; |
struct object robj; |
struct object robj = OINIT; |
int s, news; |
int s, news; |
|
|
if (obj.tag != Sarray) { |
if (obj.tag != Sarray) { |
Line 202 struct object KsocketAccept(struct object obj) { |
|
Line 203 struct object KsocketAccept(struct object obj) { |
|
.... |
.... |
*/ |
*/ |
struct object KsocketAccept2(struct object obj) { |
struct object KsocketAccept2(struct object obj) { |
struct object obj1; |
struct object obj1 = OINIT; |
struct object obj2; |
struct object obj2 = OINIT; |
struct object robj; |
struct object robj = OINIT; |
int s, news; |
int s, news; |
|
|
if (obj.tag != Sarray) { |
if (obj.tag != Sarray) { |
Line 262 int KsocketSelect0(int fd,int t) { |
|
Line 263 int KsocketSelect0(int fd,int t) { |
|
integer true or false |
integer true or false |
*/ |
*/ |
struct object KsocketSelect(struct object obj) { |
struct object KsocketSelect(struct object obj) { |
struct object robj; |
struct object robj = OINIT; |
struct object ob1; |
struct object ob1 = OINIT; |
struct object ob2; |
struct object ob2 = OINIT; |
if (obj.tag != Sarray) { |
if (obj.tag != Sarray) { |
errorMsg1s("KsocketSelect([ integer socketid optional integer timeout default 0]"); |
errorMsg1s("KsocketSelect([ integer socketid optional integer timeout default 0]"); |
} |
} |
Line 294 struct object KsocketSelectMulti(struct object obj) |
|
Line 295 struct object KsocketSelectMulti(struct object obj) |
|
[ result1, result2, ....] |
[ result1, result2, ....] |
*/ |
*/ |
{ |
{ |
struct object robj; |
struct object robj = OINIT; |
struct object ob1; |
struct object ob1 = OINIT; |
struct object ob2; |
struct object ob2 = OINIT; |
struct object ob3; |
struct object ob3 = OINIT; |
int size,i,fd,p,t; |
int size,i,fd,p,t; |
fd_set readfds; |
fd_set readfds; |
struct timeval timeout; |
struct timeval timeout; |
Line 373 static char Data00[1024]; |
|
Line 374 static char Data00[1024]; |
|
string data |
string data |
*/ |
*/ |
struct object KsocketRead(struct object obj) { |
struct object KsocketRead(struct object obj) { |
struct object ob1; |
struct object ob1 = OINIT; |
struct object robj = NullObject; |
struct object robj = NullObject; |
static int datasize = 1024; |
static int datasize = 1024; |
static char *data = Data00; |
static char *data = Data00; |
Line 435 struct object KsocketRead(struct object obj) { |
|
Line 436 struct object KsocketRead(struct object obj) { |
|
/* [ integer socketid, string data ] |
/* [ integer socketid, string data ] |
integer */ |
integer */ |
struct object KsocketWrite(struct object obj) { |
struct object KsocketWrite(struct object obj) { |
struct object ob1; |
struct object ob1 = OINIT; |
struct object ob2; |
struct object ob2 = OINIT; |
int socketid; |
int socketid; |
int r; |
int r; |
int k,k0; |
int k,k0; |
Line 472 struct object KsocketWrite(struct object obj) { |
|
Line 473 struct object KsocketWrite(struct object obj) { |
|
} |
} |
struct object KsocketClose(struct object obj) { |
struct object KsocketClose(struct object obj) { |
int socketid; |
int socketid; |
struct object ob1; |
struct object ob1 = OINIT; |
if (obj.tag != Sarray) { |
if (obj.tag != Sarray) { |
errorMsg1s("KsocketClose([ integer socketid ])"); |
errorMsg1s("KsocketClose([ integer socketid ])"); |
} |
} |
Line 499 struct object KsocketReadByte(struct object obj); |
|
Line 500 struct object KsocketReadByte(struct object obj); |
|
struct object KsocketWriteByte(struct object obj); |
struct object KsocketWriteByte(struct object obj); |
|
|
struct object KsocketReadByte(struct object obj) { |
struct object KsocketReadByte(struct object obj) { |
struct object ob1; |
struct object ob1 = OINIT; |
struct object robj = NullObject; |
struct object robj = NullObject; |
char data[2]; |
char data[2]; |
char *tmp; |
char *tmp; |
Line 540 struct object KsocketReadByte(struct object obj) { |
|
Line 541 struct object KsocketReadByte(struct object obj) { |
|
/* [ integer socketid, int ] |
/* [ integer socketid, int ] |
integer */ |
integer */ |
struct object KsocketWriteByte(struct object obj) { |
struct object KsocketWriteByte(struct object obj) { |
struct object ob1; |
struct object ob1 = OINIT; |
struct object ob2; |
struct object ob2 = OINIT; |
int socketid; |
int socketid; |
int r,i,n,kk,r0; |
int r,i,n,kk,r0; |
#define DATA_SIZE 1024 |
#define DATA_SIZE 1024 |
Line 600 struct object KsocketWriteByte(struct object obj) { |
|
Line 601 struct object KsocketWriteByte(struct object obj) { |
|
|
|
struct object KsocketReadHTTP(struct object socketObj) { |
struct object KsocketReadHTTP(struct object socketObj) { |
/* Read until two empty line appears. */ |
/* Read until two empty line appears. */ |
struct object ob; |
struct object ob = OINIT; |
struct object ob1; |
struct object ob1 = OINIT; |
struct object nob; |
struct object nob = OINIT; |
char *s; |
char *s; |
char *sss; |
char *sss; |
char *tmp; |
char *tmp; |