-
Notifications
You must be signed in to change notification settings - Fork 278
openUDP
Jason Watkins edited this page Apr 3, 2015
·
13 revisions
Opens a new UDP socket, binding the incoming port and storing the outgoing host and port.
Language | Signature |
---|---|
C | struct xpcSocket openUDP(unsigned short port_number, const char *xpIP, unsigned short xpPort) |
MATLAB | function [socket] = openUDP(port, varargin) |
Java | XPlaneConnect(int port, String xplaneHost, int xplanePort, int timeout) |
Python | N/A |
Error Code | Exception | Description |
---|---|---|
SocketException | The incoming port could not be bound | |
UnknownHostException | The specified X-Plane host could not be resolved |
readfd = openUDP(49055, IP, PORT); //Open socket for receiving
sendfd = openUDP(49077, IP, PORT); //Open socket for sending
// Use sockets
closeUDP(readfd);
closeUDP(sendfd);
Socket = openUDP(49005);
// Use socket
closeUDP(Socket);
try(XPlaneConnect xpc = new XPlaneConnect())
{
// Use socket
}