Subversion Repositories HelenOS

Rev

Rev 4712 | Rev 4730 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4712 Rev 4726
Line 133... Line 133...
133
    }
133
    }
134
    socket->port = port;
134
    socket->port = port;
135
    return EOK;
135
    return EOK;
136
}
136
}
137
 
137
 
138
int socket_create( socket_cores_ref local_sockets, int app_phone, int * socket_id ){
138
int socket_create( socket_cores_ref local_sockets, int app_phone, void * specific_data, int * socket_id ){
139
    ERROR_DECLARE;
139
    ERROR_DECLARE;
140
 
140
 
141
    socket_core_ref socket;
141
    socket_core_ref socket;
142
    int             res;
142
    int             res;
143
 
143
 
Line 145... Line 145...
145
    socket = ( socket_core_ref ) malloc( sizeof( * socket ));
145
    socket = ( socket_core_ref ) malloc( sizeof( * socket ));
146
    if( ! socket ) return ENOMEM;
146
    if( ! socket ) return ENOMEM;
147
    // initialize
147
    // initialize
148
    socket->phone = app_phone;
148
    socket->phone = app_phone;
149
    socket->port = -1;
149
    socket->port = -1;
150
    socket->device_id = -1;
-
 
151
    socket->peer_addr = NULL;
150
    socket->specific_data = specific_data;
152
    if( ERROR_OCCURRED( dyn_fifo_initialize( & socket->received, SOCKET_INITIAL_RECEIVED_SIZE ))){
151
    if( ERROR_OCCURRED( dyn_fifo_initialize( & socket->received, SOCKET_INITIAL_RECEIVED_SIZE ))){
153
        free( socket );
152
        free( socket );
154
        return ERROR_CODE;
153
        return ERROR_CODE;
155
    }
154
    }
156
    if( ERROR_OCCURRED( dyn_fifo_initialize( & socket->accepted, SOCKET_INITIAL_ACCEPTED_SIZE ))){
155
    if( ERROR_OCCURRED( dyn_fifo_initialize( & socket->accepted, SOCKET_INITIAL_ACCEPTED_SIZE ))){